NYCPHP Meetup

NYPHP.org

[nycphp-talk] [OT] MySQL Queue

Rob Marscher rmarscher at beaffinitive.com
Tue Apr 17 14:48:29 EDT 2007


On 4/17/07, Ben Sgro (ProjectSkyline) <ben at projectskyline.com> wrote:
> 1) Every x min, select the oldest time from the queue (LIMIT 1)
> 2) DELETE that row from the queue

I assume that just one parent process would be performing this and  
then forking a process to handle the job afterwards, right?   
Otherwise, you'd have the chance that two processes would read the  
queue at the same time and process the same job -- in that case, a  
read lock could work.

I've only done forking in C.  I saw this in the php manual: "Process  
Control support in PHP is not enabled by default. You have to compile  
the CGI or CLI version of PHP with --enable-pcntl configuration  
option when compiling PHP to enable Process Control support."  The  
examples in the manual seem like a good starting point:  http:// 
us2.php.net/manual/en/ref.pcntl.php

-Rob



More information about the talk mailing list