[nycphp-talk] Re: semaphores on Windows

Ivan Tumanov ivan.nyphp at
Tue Mar 11 16:19:45 EST 2003

Check this page:

Look up the GET_LOCK, RELEASE_LOCK and IS_FREE_LOCK functions.  I've had
mixed luck using them w/ php because the locking is per-thread, and I have a
suspicion that my trouble came out of some sort of connection-sharing issue.
But this might be whate you're looking for.


-----Original Message-----
From: Emmanuel. M. Decarie [mailto:emm at]
Sent: Tuesday, March 11, 2003 9:28 AM
To: NYPHP Talk
Subject: [nycphp-talk] Re: semaphores on Windows

>How one would implement semaphores on Windows NT 5.0?
>Could I use COM for that? I'm not familiar with Windows.
>Or could it be a good idea to use files and flock?
>Any ideas? I'm a little bit afraid to implement semaphore by myself
>because it can lead to tricky situations.

I forgot to add  that I need semaphores for INSERT and DELETE sql
statement for MySQL. Maybe this is not needed after all. The rows
that are concerned are using a column with an AUTO_INCREMENT

I don't need rollback (i.e. transaction). In its book on MySQL, Paul
Dubois write: "MySQL automatically performs locking for single SQL
statements to keep clients from interfering with each other." (Paul
Dubois, MySQL, New Riders, 2000).

Emmanuel Décarie / Programmation pour le Web - Programming for the Web
Radio UserLand/Frontier - Perl - PHP - Javascript
Blog: <> - AIM: scriptdigital

--- Unsubscribe at ---

More information about the talk mailing list