Scheduler Pattern

When there are concurrent requests for a resource, it is necessary to synchronize access.

Therefore:

Implement a scheduler that selects which request will be allowed to execute next.

Scheduling policies may be first-come/first-served, priority-based, or otherwise.

Using the Strategy Pattern, one can customize the behavior of the scheduler for particular configurations or applications.

Consider the Command Pattern for representation of queued requests.


See original on c2.com