Within the two most common priority classes-time-critical and regular-there are certain broad guidelines recommended for choosing the priority level for a program.
The guidelines for level within the time critical class are set to maximize the number of different applications that can successfully multitask in an OS/2 system. The guidelines are described in the following table.
Recommended Priority Levels for Time-Critical Threads
┌────────────────────┬────────────────────┬────────────────────────────────────────────────────────────┐ │Activity │Range of Recommended│Justification/Comments │ │ │Priority Levels │ │ ├────────────────────┼────────────────────┼────────────────────────────────────────────────────────────┤ │Robotics/Real time │20-31 │OS/2 systems can be used on manufacturing lines to control │ │process control │ │equipment or in other real time process control │ │ │ │applications. In this case a slow response from the PC could│ │ │ │cause expensive damage to equipment or even human injury. │ │ │ │Therefore the highest priority levels should be reserved for│ │ │ │these applications. │ ├────────────────────┼────────────────────┼────────────────────────────────────────────────────────────┤ │Communications │10-19 │In communications, the inability to get the processor could │ │ │ │cause a loss of data or communications sessions. Therefore │ │ │ │this class of applications is next highest. │ ├────────────────────┼────────────────────┼────────────────────────────────────────────────────────────┤ │Other │0-09 │Other threads might need to preempt the foreground in │ │ │ │special cases (for example, Control-Break). These should be │ │ │ │set below the other 2 classes. │ └────────────────────┴────────────────────┴────────────────────────────────────────────────────────────┘
In general, application performance is not a good reason to make a thread time critical.
In cases where explicit priority levels are set, they should follow the guidelines listed below.
Recommended Priority Levels for Regular Priority Threads
┌────────────────────┬────────────────────┬──────────────────────────────────────────────────┐ │Activity │Range of Recommended│Justification │ │ │Priority Level │ │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────┤ │Communications │26-31 │Communications should take priority over other │ │ │ │background processing to increase overlap with │ │ │ │transmission and processing on the partner PC or │ │ │ │host. This gives the best system performance. │ ├────────────────────┼────────────────────┼──────────────────────────────────────────────────┤ │Other │0-25. │If an application has multiple threads it might be│ │ │ │necessary to set them to several different │ │ │ │priorities to optimize the order in which they │ │ │ │run. A range of priority levels is provided to │ │ │ │facilitate this. (The default priority is regular │ │ │ │class, level = 0.) │ └────────────────────┴────────────────────┴──────────────────────────────────────────────────┘