RE: [GD-Windows] TryEnterCriticalSection
Brought to you by:
vexxed72
From: Andy G. <an...@mi...> - 2002-01-03 19:41:43
|
There is a good performance comparison of different sync objects found at=20 http://www.usenix.org/publications/library/proceedings/usenix-nt98/full_ papers/zabatta/zabatta_html/zabatta.html It depends upon what you are trying to do and how often you will check/set/block in your code. Personally I would write my own sync object using _asm lock cmpxchg - then it would run on all CPUs 486 and above... There are very neat sync objects in the later OS's - SLIST for example is very clever, but only in XP and above (of course, you could implement it yourself without too much trouble) - also spin locks may be useful if you only lock the resource very briefly. Andy Glaister. -----Original Message----- From: Brian Hook [mailto:bri...@py...]=20 Sent: Thursday, January 03, 2002 11:18 AM To: gam...@li... Subject: [GD-Windows] TryEnterCriticalSection It looks like TryEnterCriticalSection is only available on >=3D NT4 (and according to the docs, it's not available on Win9x at all). To get around this I'm thinking that I could switch to using a mutex and WaitForSingleObject with a timeout of 0 milliseconds, but mutexes are heavier weight than critical sections (I'm not sure how bad this is in practice though). Any opinions, comments or shared experiences with this? Brian _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows |