CMS Multitasking Application Programming documentation draws a distinction between voluntary and involuntary loss of control by a thread. Blocking and yielding in a thread are easily understood as causes for voluntary loss of control. Preemption would appear to be just as easily understood.
However, the observed behavior of a running application doesn¹t appear to obey the documentation which states in part that at the CMS thread level you can involuntarily (preemptively) lose control to threads in different classes. Alternatively stated, a compute bound thread in the same class as three siblings will never cede control to one of the three siblings but should cede control to threads of higher priority outside it dispatch class. Thread priorities can be established at thread creation time as a plus or minus offset of the creating thread priority. I have an application which creates 6 threads all all of which are given a distinct classes and various priorities at the point of creation. The lowest priority thread is the most compute intensive. All threads other than the compute bound thread exhibit blocking or yielding behavior necessary for voluntary loss of control; the compute bound thread does not. The compute bound thread is the only one that gets dispatched. Preemption at the virtual machine level works beautifully or this would be a really small forum. Given the content of the manual I would expect that the compute bound thread would involuntarily lose control at some point to the higher priority threads in different classes. Questions: 1. Does CMS preemptively dispatch threads as the documentation implies? 2. If so, is there some VM or CMS configuration option that is used to ensure this happens? Thanks --. .- .-. -.-- Gary Dennis Mantissa Corporation
