Subj : Re: SEM_UNDO substitute on windows To : comp.programming.threads From : Joe Seigh Date : Mon May 23 2005 12:39 pm On 23 May 2005 06:39:52 -0700, wrote: > Thanks for your response. > I am using semaphores to check if an application is already running > (application tries to acquire lock on a semaphore and if times out, it > must have been acquired by another instance of the application). In > case if this application exits (May be user exits which is very good > and may be because windows decides that it must be crashed now and > thats where the requirement for SEM_UNDO) the semaphore operations it > did must be undone so that another instance of application would be > able to acquire lock on this semaphore and go ahead with execution. I > would be happy to get any robust solution for this problem, but somehow > I imagined that using semaphores would be a good solution (until I > realize that SEM_UNDO is not supported on windows). Any input is > welcome. The fact that you're using synchronization means that the state of the data matters. What do you think the state of the application's data is in if it crashes? -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. .