Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scenarios for Thread Ordering Service

Reading up the new Vista/Win2008 features, I wonder what is the point of the Thread Ordering Service. In other words, in which scenario the "classic" scheduler's "fair to all" policy is not sufficient, and a definite order of threads is preferrable?

To clarify. What would be a concrete application that would benefit from it?

Thanks for your answers, though.

like image 477
peterchen Avatar asked Nov 06 '22 22:11

peterchen


2 Answers

The Thread Ordering Service does not apply to all threads, but only to those that are registered to it. You must make your program use the functionality.

The Service ensures that threads are executed in a desirable (configurable) order. That cannot be guaranteed by a "fair for all" scheduler. If your threads have no preferred execution order, the service probably does not provide extra value to you.

like image 172
Tomalak Avatar answered Nov 15 '22 12:11

Tomalak


The Thread Ordering Service provides cooperative multi-threading in a pre-emptive multi-threading world. When you create the group you specify the maximum time slice that can be used by a thread in the group (period + timeout), and how often to run the group (period).

Your threads will then be run at most once per period, and will get an error if they exceed their maximum time slice.

I imagine this works quite well in scenarios where there's a hard response time limit.

like image 44
Anthony Williams Avatar answered Nov 15 '22 11:11

Anthony Williams