Process Queues

Name

Process Queues -- Process Queue Handling.

Synopsis


typedef     proc_queue_t;
#define     DECLARE_PROC_QUEUE              (queue)
#define     proc_queue_empty                (queue)
#define     proc_data                       (element)
#define     proc_queue_next                 (element)
#define     proc_queue_find                 (queue, proc)
#define     proc_queue_len                  (queue)
#define     proc_queue_init                 (queue)
#define     proc_queue_foreach              (queue, func, data)
#define     proc_queue_concat               (dest, orig1, orig2)
#define     proc_queue_remove               (queue, proc)
#define     proc_queue_append               (queue, proc)
#define     proc_queue_nth                  (queue, n)
#define     proc_queue_end                  (element)

Description

This are the functions to use when working with any queue of processes in the CPU.

Details

proc_queue_t


DECLARE_PROC_QUEUE()

#define     DECLARE_PROC_QUEUE(queue)

Declares a new and empty process queue with name queue.

queue : name for the queue.


proc_queue_empty()

#define     proc_queue_empty(queue)

Is queue empty?

queue : process queue involved.


proc_data()

#define     proc_data(element)

Retrives the process data from the queue element.

element : process queue element involved.


proc_queue_next()

#define     proc_queue_next(element)

Gets the next element on the queue starting at element.

element : process queue element involved.


proc_queue_find()

#define     proc_queue_find(queue, proc)

Find the queue element for process proc.

queue : process queue involved.
proc : process involved.


proc_queue_len()

#define     proc_queue_len(queue)

Calculate the number of elements on queue.

queue : process queue involved.


proc_queue_init()

#define     proc_queue_init(queue)

Initializes process queue queue.

Note: applyed to a non empty queue will loose all its elements.

queue : process queue involved.


proc_queue_foreach()

#define     proc_queue_foreach(queue, func, data)

Will call func for every process on queue using the process pointer as the first arguemt and data as the second.

queue : process queue involved.
func : function to be called.
data : second argument to func.


proc_queue_concat()

#define     proc_queue_concat(dest, orig1, orig2)

Concatenates orig1 and orig2 into dest.

dest : Target queue.
orig1 : First source queue.
orig2 : Second source queue.


proc_queue_remove()

#define     proc_queue_remove(queue, proc)

Remove proc from queue.

queue : process queue involved.
proc : process to be removed.


proc_queue_append()

#define     proc_queue_append(queue, proc)

Append proc to queue.

queue : process queue involved.
proc : process to be appended.


proc_queue_nth()

#define     proc_queue_nth(queue, n)

Get element number n from queue.

queue : queue involved.
n : element index.


proc_queue_end()

#define proc_queue_end(element) proc_queue_empty(element)

Is this element the end of the queue?

element : process queue element involved.