mpool icon indicating copy to clipboard operation
mpool copied to clipboard

will it support a flag to indicate a desired pool used or not ?

Open qianguozheng opened this issue 9 years ago • 2 comments

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.

qianguozheng avatar May 11 '16 03:05 qianguozheng

It doesn't have locking, so using it with multiple threads will not work well.

silentbicycle avatar May 11 '16 12:05 silentbicycle

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

qianguozheng avatar May 16 '16 03:05 qianguozheng