> > For #2, yes, the semaphores will go away when the last
> process holding
> > a HANDLE to it goes away. For #1, the code seems to handle
> that right?
> >
>
> I intentionally use *unnamed* semaphores to avoid these
> problems -- even if the semaphores didn't go away (as Magus
> pointed out, if all processes can exit gracefully, this won't
> happen), we won't worry about them -- Creating semahpores
> will still succeed because there is no existent same named
> semaphores will bother it.
Just a point - they will get automatically cleaned up even if the
process doesn't exit *gracefully*, as long as it exits. Only if it's
hung and won't actually exit will the handles not get cleaned up.
This goes for both named and unnamed ones.
//Magnus