Page 1 of 1

Managing tasks

Posted: Tue Nov 19, 2013 3:41 pm
by StephenTaylor
I want to manage multiple calculation jobs. Each job runs for from 2 min to 2 hours and handles only files. No interaction with the user once specified: just wind it up and go. So naturally I want to run the jobs 'in background', leaving the user interface free and setting the stage for parallelisation.

But while I want the jobs to run without access to the UI (such as a progress bar), I still want to be able to monitor status: how many jobs queued, finished, how many running and how far along.

Threads are an obvious candidate, but I might want greater decoupling from the use's task than that. Seems to me the user should be able to queue up jobs to run overnight, exit the app and open it next morning to see what she's got. I would be hard pressed to defend this as a requirement, but seems wrong for background job processing to rely on state in the user's app.

So I'm thinking of something like a COM wrapper for a job. It would run the job itself and own an environment in which the job can write status and a log. My user's application would have a TaskMaster object that would start the jobs, poll the wrappers for status and report status in HTML on request.

As stated the problem seems pretty generic, and the tools I contemplate are not new. Have you experience or an alternative approach you could share?