Suiden
Suiden

Reputation: 642

Task scheduler for tasks that spawn other tasks

I'm trying to implement a screensaver that draws shapes on the screen once every minute. For me, drawing a line is a task and creating a shape is also a task. My requirements are:

Any idea how a task scheduler for this looks like?

Upvotes: 0

Views: 235

Answers (1)

svick
svick

Reputation: 244767

I think TaskScheduler is not the right tool for this job. Actually, I think TPL is not the right tool at all.

You don't want to compute different tasks concurrently to gain performance, which is what TPL is for. You want different things to happen on the screen at the same time. That's something completely different and you don't need parallelism for that.

You just need to figure out the rules when do you want new shape to start being drawn and what are the rules for what kind of shape it can be.

Upvotes: 1

Related Questions