Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
AnswerRe: what is the optimal method for handling time-triggered processing Pin
Matthew Klein9-Mar-10 7:48
Matthew Klein9-Mar-10 7:48 
GeneralRe: what is the optimal method for handling time-triggered processing Pin
TimWallace9-Mar-10 7:51
TimWallace9-Mar-10 7:51 
GeneralRe: what is the optimal method for handling time-triggered processing Pin
Not Active9-Mar-10 8:01
mentorNot Active9-Mar-10 8:01 
GeneralRe: what is the optimal method for handling time-triggered processing Pin
TimWallace9-Mar-10 9:17
TimWallace9-Mar-10 9:17 
GeneralRe: what is the optimal method for handling time-triggered processing Pin
Matthew Klein9-Mar-10 11:02
Matthew Klein9-Mar-10 11:02 
AnswerRe: what is the optimal method for handling time-triggered processing Pin
Ian Shlasko9-Mar-10 8:30
Ian Shlasko9-Mar-10 8:30 
AnswerRe: what is the optimal method for handling time-triggered processing Pin
Ennis Ray Lynch, Jr.9-Mar-10 9:46
Ennis Ray Lynch, Jr.9-Mar-10 9:46 
AnswerRe: what is the optimal method for handling time-triggered processing Pin
Luc Pattyn9-Mar-10 11:09
sitebuilderLuc Pattyn9-Mar-10 11:09 
Hi,

Maybe I still did not fully understand it, however I see no major problem.
I assume the server has all necessary data available, so it can compute when it decides to do so; the client involvement is limited to receiving a "done" signal.

Here is my attempt to keep it simple:

1. the server maintains a database table "tasks" with fields "clientID", "startTime", "state", and more if necessary.
2. the server has one or a few threads that:
- execute a transaction containing a task fetch ("SELECT TOP 1 FROM tasks WHERE state='idle' ORDER BY startTime") and an assignment setting state to "assigned".
- wait until the start time is reached;
- execute the task;
- update the state to "done"
3. the client has a thread polling the same database (say once a minute), looking for its task with a "done" state.

Pros:
1. Simple.

Cons:
1. An urgent task added at the last moment, will not execute right away, as each server thread is either busy, or has already decided which task to do next. So the latency is one full task.
2. The client isn't event driven, as servers are not supposed to send something to their clients without an explicit request.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.

AnswerRe: what is the optimal method for handling time-triggered processing Pin
AspDotNetDev9-Mar-10 12:18
protectorAspDotNetDev9-Mar-10 12:18 
GeneralRe: what is the optimal method for handling time-triggered processing Pin
TimWallace9-Mar-10 13:39
TimWallace9-Mar-10 13:39 
AnswerRe: what is the optimal method for handling time-triggered processing Pin
PIEBALDconsult9-Mar-10 13:39
mvePIEBALDconsult9-Mar-10 13:39 
QuestionSave an object to my exe? Pin
Matthew Klein9-Mar-10 5:38
Matthew Klein9-Mar-10 5:38 
AnswerRe: Save an object to my exe? Pin
Not Active9-Mar-10 6:47
mentorNot Active9-Mar-10 6:47 
AnswerRe: Save an object to my exe? Pin
Dan Mos9-Mar-10 6:47
Dan Mos9-Mar-10 6:47 
AnswerRe: Save an object to my exe? Pin
Luc Pattyn9-Mar-10 7:09
sitebuilderLuc Pattyn9-Mar-10 7:09 
GeneralRe: Save an object to my exe? Pin
Som Shekhar9-Mar-10 7:26
Som Shekhar9-Mar-10 7:26 
GeneralRe: Save an object to my exe? Pin
Luc Pattyn9-Mar-10 9:42
sitebuilderLuc Pattyn9-Mar-10 9:42 
AnswerRe: Save an object to my exe? Pin
Dave Kreskowiak9-Mar-10 7:32
mveDave Kreskowiak9-Mar-10 7:32 
AnswerRe: Save an object to my exe? Pin
Matthew Klein9-Mar-10 7:44
Matthew Klein9-Mar-10 7:44 
AnswerRe: Save an object to my exe? Pin
#realJSOP9-Mar-10 8:40
mve#realJSOP9-Mar-10 8:40 
AnswerRe: Save an object to my exe? Pin
AspDotNetDev9-Mar-10 12:44
protectorAspDotNetDev9-Mar-10 12:44 
AnswerRe: Save an object to my exe? Pin
AspDotNetDev9-Mar-10 12:57
protectorAspDotNetDev9-Mar-10 12:57 
GeneralRe: Save an object to my exe? Pin
Matthew Klein9-Mar-10 13:23
Matthew Klein9-Mar-10 13:23 
QuestionComparing things with null - but not for equality Pin
harold aptroot9-Mar-10 5:05
harold aptroot9-Mar-10 5:05 
AnswerRe: Comparing things with null - but not for equality Pin
Dan Mos9-Mar-10 5:33
Dan Mos9-Mar-10 5:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.