[Gc] Improving perfs on a multi CPU windows system

Boehm, Hans hans_boehm@hp.com
Tue, 2 Sep 2003 13:33:43 -0700


Thanks.

I changed this in my version, as you suggested.  Based on my reading of Microsoft's documentation
and a small amount of experimentation, _WIN32_WINNT has to be defined explicitly to reflect the target?

Hans

> -----Original Message-----
> From: Emmanuel Stapf [ES] [mailto:manus@eiffel.com]
> Sent: Wednesday, August 27, 2003 12:41 PM
> To: gc@napali.hpl.hp.com
> Subject: [Gc] Improving perfs on a multi CPU windows system
> 
> 
> Instead of using InitializeCriticalSection, we should be using
> InitializeCriticalSectionAndSpinCount. I've set it up to have 
> a spin count of 4000
> (the same value as Microsoft said it is using for the heap 
> critical section) and a
> system went from a total time of 1min to 32s. It is a huge 
> improvement.
> 
> The only issue is that it works with only the following systems:
> Included in Windows XP, Windows 2000 Professional, Windows NT 
> Workstation 4.0 SP3
> and later, Windows Me, and Windows 98.
> 
> So I'm not sure if it should be integrated, but at least we 
> could have in the GC
> code:
> 
> #if (_WIN32_WINNT >= 0x0403)
> InitializeCriticalSectionAndSpinCount (cs, 4000)
> #else
> InitializeCriticalSection (cs);
> #endif
> 
> That way it is up to the guy who compiles the code to decide 
> which platforms he is
> targeting.
> 
> Manu
> 
> 
> _______________________________________________
> Gc mailing list
> Gc@linux.hpl.hp.com
> http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/gc
>