[wp-hackers] WP cron and "multi-threading"

Mark Jaquith mark.wordpress at txfx.net
Mon Oct 9 06:00:35 GMT 2006


On Oct 9, 2006, at 12:14 AM, Robert Deaton wrote:

>> Mark Jaquith wrote:
>> > You need to expire the "cron_is_running" option, in case your  
>> winning
>> > race candidate dies before it gets to unset it.
>
> No, if it loses the race condition, something else has overwritten it.
> The other thread that won the race condition will clean it up when its
> finished.

It'll clean up *IF* it finishes.  What if one of the cron'd actions  
causes a fatal error?  Then you're stuck with "cron_is_running" set  
to a key that'll never be matched again.

Pretend that Tom Hanks is a process.  He claims Helen Hunt by  
marrying her.  Then, his FedEx plane crashes and he's stranded on a  
tropical island with only an inflatable ball as a companion.  Helen  
Hunt is stuck, because she can't confirm that Hanks has died or  
otherwise *explicitly* relinquished his claim on her as his spouse.   
Should she wait forever?  Nah.  She waits a few years and Hanks is  
declared legally dead, and she remarries.

Sort of like that. :-)

--
Mark Jaquith
http://txfx.net/




More information about the wp-hackers mailing list