Hi.  I am new to my my sql and have a basic question about locking.
I am running Ver 11.18 Distrib 3.23.54, for Win95/Win98.

I have a table that holds work on jobs needing processing

Field    Type            Null    Key     Default  Extra         
-------  -------------  ------  -------  --------------
jobid    int(11)                 PRI     (NULL)   auto_increment
status   enum('waiting','processing','done','failed')  YES waiting   
created  timestamp(14)     YES             (NULL)                 
details  varchar(255)      YES             (NULL)         

Right now, a single process checks this table occasionally.
If it finds rows in 'waiting' status, it grabs the info,
sets the row to 'processing', and does the computation.
Upon completion, the process stores the results elsewhere,
sets the row to 'done' (or failed, if it failed), looks for
more work to do, and sleeps a bit if there is no futher processing
to be done now.

For speed, I'd now like several processes to grab work from the table.

I am not sure how mysql handles locking.

While a process is seizing a row (changing row status from
'waiting' to 'processing'), how do I prevent another process
from grabbing the same row?

Thanks for any help or advice

-TO


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to