Page 1 of 1
Critical Sections?
Posted: Mon Jun 30, 2003 3:16 pm
by raygr
I have some files that I need to update atomically without interruptions. Is there some way to have critical sections in PHP, to avoid another script thread from running?
Thanks,
-Ray
Posted: Mon Jun 30, 2003 4:34 pm
by volka
nope, each script running should be seen as one process on its own, so only semaphores would help.
Though there is
support for semaphores if it's
only about file access take a look at
php.net/flock
Posted: Mon Jun 30, 2003 5:48 pm
by raygr
Thanks volka. I should have thought of semaphores. That will probably do the trick.