Hi Ben,
An event is considered an operating system resource. Yes, 'physically' it
involves only the memory, but the system keeps a count of allocated
handles - you can see it on the "Perfomance" tab of the Task Manager.
My understanding is the possible number of events to be created depends
totally on the amount of virtual memory available, but still Windows might
maintain some additional tables for housekeeping and this can impose
additional restrictions on the possible number of existing events. At the
moment I am writing this post there is 14960 open handles - this includes
events, mutexes, probably open files and modules, and so on.
Still, why would you need so many events created?
--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx
"Ben" <(E-Mail Removed)> wrote in message
news:EF88BAFB-BDAE-4D94-9D3C-(E-Mail Removed)...
> Hi All,
>
> In reading the documentation on AutoResetEvents and WaitHandle I'm not
> sure
> whether they are limited resources (i.e. limited by something other than
> memory). WaitHandle mentions that it uses some nebulous "operating system
> resources" and I would like to know more specifically is happening under
> the
> hood. Is it safe to allocate hundreds of thousands of these things?
>
> --Ben