On Thursday, 07/10/2008 at 06:15 EDT, "Gary M. Dennis" <[EMAIL PROTECTED]> wrote: > What we expected: Interspersed WTO's from both MAIN and THREAD1 threads > > What we get: THREAD1 WTOs only. We thought MAIN, being in a separate class > (and therefore eligible to be assigned to different CPUs) would dispatch > (and both issue WTOs) but this did not happen. In z/OS the fact that the > WTO was issued would provide sufficient dispatch latency for another task to > get a time slice. > > Additional observations: > > 1. If line write is substituted for WTO in MAIN and THREAD1 there is no > observed difference. > > 2. The program works as expected IF yield is called within the WTO loops in > MAIN and THREAD1. > > Why should yield have to be called? Any thread wizards out there?
An OS SVC (WTO, GETMAIN, FREEMAIN, XCTL, LINK, etc.) will serialize the virtual machine. No other thread will run. Further, CMS does not use pre-emptive dispatching. If THREAD1 is in a loop, never giving up control by yielding or waiting for input of some sort, then the MAIN thread will never get a chance to run. Alan Altmark z/VM Development IBM Endicott