osCreateScheduler.3p
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
.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)