views:

117

answers:

2

It's highly likely that there is a limitation on how many synchronization objects - semaphores, events, critical sections - can one process and all processes on a given machine use. What exactly is this limitation?

+2  A: 

It depends on the quota that is available for the process. I think in XP it is set to 10000 per process, but it can grow. I am not sure what the upper limit is.

Just checked it again, the 10000 limit is for the GDI handles and not for Kernel objects.

Canopus
+3  A: 

For windows, the per-process limit on kernel handles(semaphores, events,mutex) is 2^24.

From MSDN:

Kernel object handles are process specific. That is, a process must either create the object or open an existing object to obtain a kernel object handle. The per-process limit on kernel handles is 2^24. However, handles are stored in the paged pool, so the actual number of handles you can create is based on available memory. The number of handles that you can create on 32-bit Windows is significantly lower than 2^24.

aJ
"Significantly lower than 2^24" could be 200 or could be 20k. I love MSDN for such statements.
sharptooth