translating "create Semaphore" to Linux
mail at timgolden.me.uk
Fri Aug 29 14:33:22 CEST 2008
> hSem = win32event.CreateSemaphore (None, 1,
> rt=win32event.WaitForSingleObject (hSem, 0)
> if rt != win32event.WAIT_TIMEOUT:
> print "application allready running"
> to make sure that only ONE instance of the application is running at a
Running a serious risk of teaching my grandmother, but...
... why use a Semaphore rather than a Mutex? Or why not
simply use the bound socket as its own mutex? I know
Windows won't allow you to rebind the same socket to the
same addr/port in two different processes (unless perhaps
you play some trickery with the socket options).
More information about the Python-list