FreeRDP/winpr/libwinpr/utils/collections
Norbert Federa 3a58934eb2 libwinpr-utils: Use criticalsection with spincount
Use InitializeCriticalSectionAndSpinCount instead of IntializeCriticalSection.
Using spin counts for critical sections of short duration enables the calling
thread to avoid the wait operation in most situations which can dramatically
improve the overall performance on multiprocessor systems.

On Linux this change has no effect because the new winpr critical section
implementation does not use the SpinCount field under Linux because the NPTL
synchronization primitives are implemented using the extremely performant
futex system calls which have this magic already built in.

However, on Mac OS X this change improved the overall performance of the
multithreaded RemoteFX decoder by 25 percent.

I've used a SpinCount of 4000 which avoided 99 percent of the wait calls.
This value is also used by Microsoft's heap manager for its per-heap
critical sections.

Note: This change requires pull request #1397 to be merged.
2013-08-07 18:16:01 +02:00
..
ArrayList.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
BufferPool.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
CountdownEvent.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
Dictionary.c libwinpr-utils/collections: stubbed more classes 2012-12-05 19:36:45 -05:00
KeyValuePair.c libwinpr-utils/collections: stubbed more classes 2012-12-05 19:36:45 -05:00
ListDictionary.c libwinpr-utils: implement ListDictionary 2013-07-05 18:23:26 -04:00
MessagePipe.c libwinpr-utils: initial MessagePipe implementation 2013-02-20 14:48:32 -05:00
MessageQueue.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
ObjectPool.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
PubSub.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
Queue.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
Reference.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
Stack.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00
StreamPool.c libwinpr-utils: Use criticalsection with spincount 2013-08-07 18:16:01 +02:00