Embedded Xinu Network Playground COSC3300Fall2012
Process Queue API

Process queue functions manipulate the O/S process queues, which are used for everything from scheduling and timers to synchronization and interprocess communication. More...

Functions

short enqueue (short, queue)
short remove (short)
short dequeue (queue)
queue newqueue (void)
short prioritize (short, queue, ulong)

Detailed Description

Process queue functions manipulate the O/S process queues, which are used for everything from scheduling and timers to synchronization and interprocess communication.

A process ID can be in at most one queue.


Function Documentation

short dequeue ( queue  q)

Remove and return the first process on a list.

Parameters:
qqueue from which process should be removed
Returns:
process id of removed process, or EMPTY
short enqueue ( short  pid,
queue  q 
)

Insert a process at the tail of a queue.

Parameters:
pidprocess ID to enqueue
qqueue to which the process should be added
Returns:
process id of enqueued process
queue newqueue ( void  )

Initialize a new queue in the global process queue table.

Returns:
newly allocated
short prioritize ( short  pid,
queue  q,
ulong  key 
)

Prioritize a process into a queue in descending key order.

Parameters:
pidprocess id to prioritize
qqueue in which process should be prioritizeed
keysorting key (priority, for example)
Returns:
OK
short remove ( short  pid)

Remove a process from anywhere in a queue.

Parameters:
pidprocess ID to remove
Returns:
process id of removed process