Re: [PHP] usage of flock

2007-03-27 Thread Myron Turner
Richard Lynch wrote: On Fri, March 23, 2007 10:34 pm, Myron Turner wrote: I've never used locks in PHP, but have used them in Perl. In Perl a lock is automatically released on exit or when the locked file is closed. Is that not the same in PHP? According the the man page for the C version

Re: [PHP] usage of flock

2007-03-26 Thread Yvan Strahm
On 3/23/07, Myron Turner <[EMAIL PROTECTED]> wrote: Richard Lynch wrote: > On Fri, March 23, 2007 7:52 pm, Yvan Strahm wrote: > >> I am confused with the flock function and its usage. I have jobs which >> are >> stored in a database, these jobs are run by a series of job_runners >> scripts >> bu

Re: [PHP] usage of flock

2007-03-26 Thread Yvan Strahm
On 3/23/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, March 23, 2007 7:52 pm, Yvan Strahm wrote: > I am confused with the flock function and its usage. I have jobs which > are > stored in a database, these jobs are run by a series of job_runners > scripts > but sometimes the job_runners s

Re: [PHP] usage of flock

2007-03-26 Thread Richard Lynch
On Fri, March 23, 2007 10:34 pm, Myron Turner wrote: >> You can do it with flock, but then you end up sooner or later with a >> locked file from an "exit" or killed script, and then you have to >> know >> to remove locks older than X minutes. >> >> You could also just do a "mkdir" for your lock, an

Re: [PHP] usage of flock

2007-03-23 Thread Myron Turner
Richard Lynch wrote: On Fri, March 23, 2007 7:52 pm, Yvan Strahm wrote: I am confused with the flock function and its usage. I have jobs which are stored in a database, these jobs are run by a series of job_runners scripts but sometimes the job_runners stop ( server or php crash-down). So i p

Re: [PHP] usage of flock

2007-03-23 Thread Richard Lynch
On Fri, March 23, 2007 7:52 pm, Yvan Strahm wrote: > I am confused with the flock function and its usage. I have jobs which > are > stored in a database, these jobs are run by a series of job_runners > scripts > but sometimes the job_runners stop ( server or php crash-down). So i > put a > job_cont

[PHP] usage of flock

2007-03-23 Thread Yvan Strahm
Hello All, I am confused with the flock function and its usage. I have jobs which are stored in a database, these jobs are run by a series of job_runners scripts but sometimes the job_runners stop ( server or php crash-down). So i put a job_controller in crontab to check regularly if the runner