Jump to content

Scheduler pattern

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by David Gerard (talk | contribs) at 13:47, 17 February 2004 (expand beyond stub). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computer programming, the scheduler pattern is a software design pattern. It is a concurrency pattern used to explicitly control when threads may execute single-threaded code.

The scheduler pattern uses an object that explicitly sequences waiting threads. It provides a mechanism to implement a scheduling policy. It is independent of any specific scheduling policy; the policy is encapsulated in its own class, and is reusable.

The scheduler patter adds significant overhead beyond that required to call a synchronized method.

The read/write lock pattern is usually implemented using the scheduler patter to ensure fairness in scheduling.

The scheduler patter is not quite the same as the scheduled-task pattern).

See also

Lock pattern, Mediator pattern, Interruptible command, Reactor pattern