Re: Not glo-ing
Posted in 1997
>When I do onstat -g glo
> there are some columns that are not documented anywhere.
>Could someone please identify these?
>
> sched calls thread switches yield 0 yield n yield forever
>
>The yield columns are a mystery to me.
When the engine is running, the Virtural Processor executes threads. The
threads consists of stack space and heap memory which is allocated to
within the shared memory segments. When a a thread is executing, such as
a user request on one of the cpuvps, it is not pre-emptive, but gives up
control by issueing a 'yield'. There are basically three types of yields:
yield forever (in which case the only way you can begin to execute again
is for another thread to specifically activate you), yield for a given
amount of time, or yield for no amount of time.
The yield 0 is the yield for no amount of time. It is used as 'nice' code
when a thread senses that it is doing way too much work and wants to allow
another thread to have control of the processor for a bit. In effect the
thread is giving up control and placing itself at the end of the ready
queue. However, if there is no other thread ready for execution, it will
get control back immediatily.
The yield n is the yield for x amount of time. It's much like a unix
sleep() function or shell command. It tends to be used by things such as
alarms, cleanup routines, etc. Basically, once every 'x' number of
seconds, wake up and see if there is anything to do.
The yield forever is used to give up control and not be activated until
another thread
activates you. It is used for things like io completion, input from the
client program, waiting for a sort to complete, etc.
On the onstat -g glo, all of these things are counters of the number of
times that the vp has done those types of activities.
Madison Pruet