[nycphp-talk] [OT] MySQL Queue
Ben Sgro (ProjectSkyline)
ben at projectskyline.com
Tue Apr 17 14:55:45 EDT 2007
Hello,
Yes, the parent process would handle the fork,
the reaping of the children, etc...
I've looked into pcntl in the past, never got to
far w/it. I've read a lot about forking in C/Perl,
but never really had to code it myself.
Thanks, I'll go back and read the php.net stuff.
- Ben
----- Original Message -----
From: "Rob Marscher" <rmarscher at beaffinitive.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Tuesday, April 17, 2007 2:48 PM
Subject: Re: [nycphp-talk] [OT] MySQL Queue
> 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
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
More information about the talk
mailing list