Click here to Skip to main content
13,297,799 members (52,674 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi folks!

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

Posted 15-Dec-12 0:44am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 15 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100