A method of parallel processing in which there is first provided a first
thread which represents an independent flow of control managed by a
program structure, the first thread having two states, a first state
processing work for the program structure and a second state undispatched
awaiting work to process; and a second thread which represents an
independent flow of control managed by a program structure separate from
the first thread. The method includes using the second thread to prepare
work for the first thread to process and placing the work prepared by the
second thread in a queue for processing by the first thread. If the first
thread is awaiting work to process when the work prepared by the second
thread is placed in the queue, the method includes dispatching the first
thread and using it to process the work in the queue. If the first thread
is processing other work when the work prepared by the second thread is
placed in the queue, the method includes using the first thread to
complete processing of the other work, access the work in the queue, and
then process the work in the queue.