I have a table within a mySQL database, which contains a list of tasks which have to be done by several windows services. The table TASKS contains a task ID field, a target ID field and a status field (running, waiting). The target ID points to the table TASKDETAILS which contains the details what to do exactly.
Now I have several windows services on different machines, which shall look into the TASKS table, grab an item setting the status from waiting (default) to running and execute whatever there is to do. The services are not aware of each other, there is no synchronization between them. It is also not possible to set up a manager service, where the services could grab a task from without checking the database.
I could imagine that in some kind of situations, a task could be taken by two services at the same time... I read something about synchronized lists in database but I'm not sure whether this approach is the best / right one. Locking the table could be another option.
Anyone done something similar before?
Thanks in advance