osCreateScheduler.3p 1.83 KB
.TH osCreateScheduler 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osCreateScheduler \- create a RCP task scheduler
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
void osCreateScheduler(OSSched *s, void *stack, OSPri priority, u8 mode, 
                       u8 retraceCount);
.SH PARAMETERS
.TP 10
.I s
pointer to the scheduler structure to initialize. 
.TP
.I stack
pointer to the stack for the scheduler thread.
.TP
.I priority
priority for the scheduler thread.
.TP
.I mode
the video mode with which to initilize the Vi Manager.
.TP
.I retraceCount
the number of retraces per retrace message sent.

.SH DESCRIPTION
The Scheduler is a host CPU thread that is responsible for executing
audio and graphics tasks on the RCP such that host and RCP overrun is
minimized or eliminated.
.PP
Each video retrace, the Scheduler reads the new tasks generated by
scheduler client threads from the task queue and adds them to the end
of a real-time (audio) or non-real-time (graphics) task schedule list.
.PP
If the previous frame's graphics task has overrun, the Scheduler
causes the task to yield. It then runs the next audio task, resuming
the yielded task when the audio task has completely processed, and any
additional graphics tasks that are to be run to be run in the current
frame.
.PP
When a task completes, the Scheduler sends a message to the client
indicating that the work it requested is complete.
.PP
In order to use the Scheduler, you must first call 
.I osCreateScheduler()
to initialize the OSSched data structure, its message queues and the
Vi Manager. The 
.I osCreateScheduler() 
function spawns a thread to schedule and manage task execution. One of
the parameters to this call is the thread priority , which should be
higher than that of the threads which generate the command lists.
.SH "SEE ALSO"
.IR osScAddClient (3P),
.IR osScGetTaskQ (3P)