> This _is_ a race condition. I reported this at the end of june on list. > Subject: Possible race condition in pools WAS: RE: Thoughts on locks. > At the end of the thread the conclusion was to fix it, most likely > through documentation. > > Personally I think that locking on each allocation will kill performance. > Just never use a pool in two threads.
Whilst debugging some of my own code I found it usefull to add to each pool a record of the thread id (which is very cheap to retrive) and do a comparision each time you try to use it when a DEBUG flag is on. I found that to be a practical compromize to spot the issue. Dw
