Legacy Documentation

Parallel Computing Toolkit (2000)

This is documentation for an obsolete product.
Current products and services
Previous section-----Next section

The Scheduler

Whenever Queue[] is called, a process is entered into a queue on the master kernel. The scheduler QueueRun[] selects the first process in the queue as soon as a remote kernel is available. By choosing different queue implementations, you can specify which process should be considered the first one. Parallel Computing Toolkit provides a number of queues that you can use, or you can write your own. Queues are implemented in packages that you can load as needed.
Parallel`Queue`FIFO FIFOQueue: first in, first out
Parallel`Queue`Priority priorityQueue: user-definable priorities
Parallel`Queue`LIFO LIFOQueue: last in, first out (reverse)
Parallel`Queue`Interfaceinterface definitions for all queues

Packages and queue types.

$Queue the queue of waiting processes
$QueueLength the number of processes in the queue
$QueueType gives the current queue type
SetQueueType[queue]change the queue type to queue

Manipulating the queue.

This is the current queue type (the default).
In[1]:=
Out[1]=
To use priority queues, for example, load the corresponding package,
In[2]:=
In[3]:=
then change the queue type.
In[4]:=
Out[4]=
Now you can generate processes with optional priorities.
Queue[expr, Scheduling->p]queue expr with priority p

Specifying priorities.

In[5]:=
Out[5]=
Each queue type impelements the method Normal[] to give a list of the queue's contents.
In[6]:=
Out[6]=
The scheduler will schedule jobs with higher priority first. The order of the results is not affected.
In[7]:=
Out[7]=
This resets the queue type to the default.
In[8]:=
Out[8]=