Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Rasmus Lerdorf
Lars B. Jensen wrote: I would use a cronjob to make the entry rather than a user, why let the poor guy wait for you to create the content You may have 2 requests both trying to create the new cache entry, but that is much cleaner than having to deal with locking. Do a tempnam() to get a temp fi

Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Lars B. Jensen
I would use a cronjob to make the entry rather than a user, why let the poor guy wait for you to create the content You may have 2 requests both trying to create the new cache entry, but that is much cleaner than having to deal with locking. Do a tempnam() to get a temp file to write to and the

Re: [PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Rasmus Lerdorf
Cabbar Duzayak wrote: Hi All, I am using PHP on Apache/Linux with mod_php4. I need to implement a lazy cache for some resource which should be updated say every 1 hour in a way that the first person who arrives after an hour will be updating the cache. As you can imagine, I need to implement a writ

[PHP] Locking in PHP (Question for PHP Gurus)

2005-04-06 Thread Cabbar Duzayak
Hi All, I am using PHP on Apache/Linux with mod_php4. I need to implement a lazy cache for some resource which should be updated say every 1 hour in a way that the first person who arrives after an hour will be updating the cache. As you can imagine, I need to implement a write lock in this case,