Adjusting Member Weights
Member processes can change their weight using the set weight call.
C |
|
C++ |
|
Java |
|
.NET |
Weight is an instance property of |
A program that can determine its own suitability for its task can adjust its weight accordingly, as in these examples. (Nonetheless, changing weight frequently can cause thrashing.)
Example 1: Resources
Consider a situation in which program performance depends upon a resource, such as long distance communications lines. Such a program could vary its weight as a function of available lines.
Example 2: Load
If a program can detect that its host computer has become heavily loaded, the program could lower its weight, allowing a member on a lightly loaded computer to become active in its place.
Example 3: System Administrator
In a third example, system administration staff track the availability of resources and the performance of various computers. In response to such information, an administrator could send a message instructing a member process to change its weight.