mpool
mpool copied to clipboard
will it support a flag to indicate a desired pool used or not ?
For example, if I have several thread running , which will malloc and free memory, I want to use memory pool to optimze it, but looks the mpool project not support FAKE free, not real free the memory, just use a flag to mark it freed, then other thread can use it to store real data.
It doesn't have locking, so using it with multiple threads will not work well.
Yeah, I want to design the pthread mutex lock for this thread, but I found that just lock-unlock when malloc memory and lock-unlock when free memory, it will still occur deadlock problem, I don't have related experience, could you give me some suggestion ? thanks