Tuesday, May 17, 2005

Scheduling

It was monday afternoon. A friend of mine aproached me with a seemingly simple problem. The problem is as follows:

-There's a number of tasks, that have to be repetetly called each second. The amount of each task's repetition is fixed, and has to be met.
-Some tasks have a dependency, and thus execution order for those matters.
-One task may be used as a fill-up, when there's time left, or to drop if there is to little time.
-All tasks should be evenly distributed, in order to make the system apear as fluent as possible.

( note, these requirements are already a bogged-down version, that tries to eliminate a ton of complexities, or so we thought )

As the day progressed, and we talked for hours and wrote code and tested, it turned out this isn't a simple problem, but a hard one. In fact, we ended up with something that performed bad, and on top of that couldn't fill-up properly.

I told my friend up-front that I think that this is not one of the simple problems, vaguely remembering some school lessons about operating systems, and process scheduling. However, we tried to adjust requirements to a form that made it all implementable, seemingly, just that we ended up having still difficulties getting it right.

It was kinda Bummer, I feel I need to ponder this problem longer, and understand more of the theory to get it precisely right. I hope I can come up with something vastly better when I get to the third or fourth rewrite.

No comments: