Subj : Heap contention/BC5.02 crt To : borland.public.cpp.borlandcpp From : Björn Lantz Date : Thu Nov 18 2004 11:58 am Hi, I have identified a performance issue for my application that spawns of lot of threads that make tons of malloc/free. It runs well on single-processor systems, but it runs *slower* the more processors I run it on. I link with the MT libraries. I checked the runtime libraries and found s a lock (EnterCriticalSection/LeaveCriticalSection) for the heap functions that seem to be causing this due to that the the remaining timeslice for a thread is given away as soon as a lock is encountered. Then I think that the context switching overhead is the problem. After searching the net i found a commercial product that, according to the description, could help. My question is if there is a free alternative, or maybe some addition to the BC5.02 runtime libs that has a SMP-optimized heap manager or maybe a way to set local heaps per thread within a process? My very best, /Björn Lantz .