Big size of CRITICAL_SECTION

AFAIK using of critical sections is the quickest official way to synchronize threads in application. But it has a lack: it's size. This strucrure is much bigger than simple DWORD. I have thousands items. Access to them must be synchronized. Using of big structures leads to lack of memory. I think that simple DWORD or even BYTE (or more even one bit) will be enough for me for using as semaphore. Should I invent my own functions for using DWORD as semaphore by using some Interlock functions? Is there more simple official way to synchronize threads other than critical sections?
The system wide sync object are manipulated using handles. That's the DWORD you see, but the reference a somewhat larger data structure in the kernel.

So yes, a handle is larger than a CRITICAL_SECTION, but the Semaphore, Event, Mutex, ... are larger than handles too.
Topic archived. No new replies allowed.