Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 8
Get scheduler information
#include <sys/neutrino.h>
int SchedInfo( pid_t pid,
int policy,
struct _sched_info* info );
int SchedInfo_r( pid_t pid,
int policy,
struct _sched_info* info );
- pid
- A process ID, or 0 to get information about the current process.
- policy
- One of the following:
- SCHED_FIFO — a fixed-priority scheduler in which
the highest priority, ready thread runs until it blocks or is preempted
by a higher-priority thread.
- SCHED_RR — the same as SCHED_FIFO,
except threads at the same priority level timeslice (round robin) every
4 × the clock period (see
ClockPeriod()).
- SCHED_OTHER — currently the same as
SCHED_RR.
- SCHED_SPORADIC — sporadic scheduling.
For more information, see
pthread_attr_setschedpolicy(),
and
“Scheduling algorithms”
in the chapter on the Neutrino microkernel in the
System Architecture guide.
- info
- A pointer to a _sched_info structure where the function
can store the scheduler information.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
These kernel calls return information about the kernel's thread scheduler, including the minimum
and maximum thread priority, for the process ID specified by pid when using the
specified scheduling policy. If pid
is 0, the scheduler information for the current process is
returned. In either case, the struct _sched_info pointed
to by info is filled in with the appropriate information.
The SchedInfo() and SchedInfo_r()
functions are identical except in the way they indicate errors.
See the Returns section for details.
The struct _sched_info structure pointed to by info
contains at least these members:
- uint64_t interval
- The current execution time limit before the thread is suspended
in favor of the scheduler.
- int priority_max
- The maximum priority for a thread using this scheduling
policy.
- int priority_min
- The minimum priority for a thread using this scheduling
policy.
The only difference between these functions is the way they indicate errors:
- SchedInfo()
- If an error occurs, -1 is returned and
errno
is set. Any other value returned
indicates success.
- SchedInfo_r()
- EOK is returned on success. This function does NOT set errno.
If an error occurs, any value in the Errors section may be returned.
- EINVAL
- The pid or policy is invalid.
- ENOSYS
- The SchedInfo() function isn't supported by this
system.
- ESRCH
- The process specified by pid doesn't exist.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
sched_get_priority_max(),
sched_get_priority_min(),
sched_rr_get_interval(),
SchedGet(),
SchedSet()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 244
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/schedinfo.html on line 244