Any task-control algorithms programming practices?

Posted by NumberFour on Stack Overflow See other posts from Stack Overflow or by NumberFour
Published on 2010-04-10T14:31:34Z Indexed on 2010/04/10 14:43 UTC
Read the original article Hit count: 696

Hi,

I was just wondering if there's any field which concerns the task-control programming (or at least that's the way I call it).

For a better explanation of task-control consider the following scenario:

An application (master-thread) waits for a command - which might be a particular action or a set of actions the application should perform.

When a command is received the master-thread creates a task (= spawns an independent thread which actually does the action) and adds a record in it's task-list - thus keeping track of the time of execution, thread handle, task priority...etc.

The master-thread awaits for any other incoming commands while taking care of all the tasks - e.g: kills tasks running too long, prioritizes tasks with higher priorities, kills a task on a request of another task, limits the number of currently running tasks, allows task scheduling, cleans finished tasks (threads) and so on. The model is pretty similar to what we can see in OS dealing with running processes.

Are there any good practices programming such task-models or is there some theoretical work done in this field? Maybe my question is too generalized, but at least I wanted to know whether there are any experiences working on such models or if there's a better approach.

Thanks for any answers.

© Stack Overflow or respective owner

Related posts about multithreading

Related posts about theoretical