Multiple preemptive threads

However on a few systems you may see something like this:

-128
-127
-126
-125
-124
-123
-128
-127
-126
-125
-128
-127
-126
-125
-124
-123
-122
-121
-120
-119
-124
-123
...
125
126
127

In this case output from the three different threads is intermixed. Some systems use cooperative threads that require a thread to explicitly yield control before other, equal priority threads get a chance to run. Other systems use preemptive threading in which the virtual machine guarantees that all threads of the same priority get time in which to run. However, even on preemptive VMs this thread takes so little time to run it's unlikely any intermixing will occur.


Previous | Next | Top | Cafe au Lait

Copyright 1997 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified December 2, 1997