Subj : Re: SEM_UNDO substitute on windows To : comp.programming.threads From : Joe Seigh Date : Tue May 24 2005 12:01 pm On 24 May 2005 06:40:27 -0700, Vyacheslav Kononenko wrote: > > Joe Seigh wrote: >> On 23 May 2005 00:14:37 -0700, wrote: >> >> > Hi, >> > Is there any substitute for SEM_UNDO functionality (offered by unix >> > semaphore implementation) on Windows. Solution may use anything > other >> > than semaphore if it offers similar functionality. >> > Thanks in advance, >> > Deepesh >> > >> Windows is already broken. You don't need to break it any further >> with some dubious use of SEM_UNDO. There are some legtimate uses >> of SEM_UNDO but I doubt this is the case here. >> >> You can wait on thread handles or there may be some general > notification >> mechanism for thread termination. Though if you're thinking of > "unlocking" >> a semaphore when the protected data is in an undefined state, it > would be >> much easier and quicker to just not use the semaphore in the first > place. >> > > Hmm. How about a case when I have one writer and many readers and one > of the readers crashes? That should be safe to just unlock in this > case. Am I wrong? > That will work. I've posted rwlock code based on unix semaphores that does just that for the reader locks. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .