Name
Processor Status -- Status of the processor.
Description
Here is descrived show to find out the status of the processor,
the currently running process and all the ready queues.
There are also functions to move processes around and change
the number of ready queues.
Details
struct proc_queues_t
typedef struct { /* Processor status */
gint nqueues; /* Number of queues */
proc_t *current; /* Currently running process */
proc_queue_t *queue; /* Ready process queues */
proc_queue_t wait; /* Blocked processes */
} proc_queues_t; |
get_CPU_queues ()
Retrive the processor's status.
get_CPU_current_proc ()
proc_t* get_CPU_current_proc (void); |
request_nqueues ()
gint request_nqueues (gint nqueues); |
Sets the number of queues for handling ready processes.
NOTE: when shrinking the lower queues, those which will be deleted, must be
empty or otherwise they will be concatenated to the first queue.
move_proc_to_queue ()
void move_proc_to_queue (proc_t *proc,
gint new_queue); |
Move proc to queue number new_queue.
NOTE: The proc should not be blocked.
move_proc_to_CPU ()
void move_proc_to_CPU (proc_t *proc); |
Starts running process proc.
NOTE: the processor should be idle.
suspend_proc ()
gint suspend_proc (proc_t *proc); |
Move proc out of the way when it blocks.
wakeup_proc ()
gint wakeup_proc (proc_t *proc); |
Move a process back when it becomes ready again letting the current
algorithm decide were to put it.
See Also
- Process Queues
How to inspect process queues.