| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Basic Library Functions Oracle Solaris 11 Information Library |
enable_extended_FILE_stdio(3C)
posix_spawnattr_getschedparam(3C)
posix_spawnattr_getschedpolicy(3C)
posix_spawnattr_getsigdefault(3C)
posix_spawnattr_getsigignore_np(3C)
posix_spawnattr_getsigmask(3C)
posix_spawnattr_setschedparam(3C)
posix_spawnattr_setschedpolicy(3C)
posix_spawnattr_setsigdefault(3C)
posix_spawnattr_setsigignore_np(3C)
posix_spawnattr_setsigmask(3C)
posix_spawn_file_actions_addclose(3C)
posix_spawn_file_actions_addclosefrom_np(3C)
posix_spawn_file_actions_adddup2(3C)
posix_spawn_file_actions_addopen(3C)
posix_spawn_file_actions_destroy(3C)
posix_spawn_file_actions_init(3C)
pthread_attr_getdetachstate(3C)
pthread_attr_getinheritsched(3C)
pthread_attr_getschedparam(3C)
pthread_attr_getschedpolicy(3C)
pthread_attr_setdetachstate(3C)
pthread_attr_setinheritsched(3C)
pthread_attr_setschedparam(3C)
pthread_attr_setschedpolicy(3C)
pthread_barrierattr_destroy(3C)
pthread_barrierattr_getpshared(3C)
pthread_barrierattr_setpshared(3C)
pthread_condattr_getpshared(3C)
pthread_condattr_setpshared(3C)
pthread_cond_reltimedwait_np(3C)
pthread_key_create_once_np(3C)
pthread_mutexattr_getprioceiling(3C)
pthread_mutexattr_getprotocol(3C)
pthread_mutexattr_getpshared(3C)
pthread_mutexattr_getrobust(3C)
pthread_mutexattr_setprioceiling(3C)
pthread_mutexattr_setprotocol(3C)
pthread_mutexattr_setpshared(3C)
pthread_mutexattr_setrobust(3C)
pthread_mutex_getprioceiling(3C)
pthread_mutex_reltimedlock_np(3C)
pthread_mutex_setprioceiling(3C)
pthread_rwlockattr_destroy(3C)
pthread_rwlockattr_getpshared(3C)
pthread_rwlockattr_setpshared(3C)
pthread_rwlock_reltimedrdlock_np(3C)
pthread_rwlock_reltimedwrlock_np(3C)
pthread_rwlock_timedrdlock(3C)
pthread_rwlock_timedwrlock(3C)
rctlblk_get_enforced_value(3C)
- preemption control
cc [flag... ]file... [library... ]#include <schedctl.h>schedctl_t *schedctl_init(void);
schedctl_t *schedctl_lookup(void);
voidschedctl_exit(void);
voidschedctl_start(schedctl_t *ptr);
voidschedctl_stop(schedctl_t *ptr);
These functions provide limited control over the scheduling of a thread (seethreads(5)).They allow a running thread to give a hint to the kernelthat preemptions of that thread should be avoided. The most likely usefor these functions is to block preemption while holding a spinlock. Improper useof this facility, including attempts to block preemption for sustained periods oftime, may result in reduced performance.
Theschedctl_init() function initializes preemption control for the calling thread and returnsa pointer used to refer to the data. Ifschedctl_init() is calledmore than once by the same thread, the most recently returned pointeris the only valid one.
Theschedctl_lookup() function returns the currently allocated preemption control data associated withthe calling thread that was previously returned byschedctl_init(). This can beuseful in programs where it is difficult to maintain local state foreach thread.
Theschedctl_exit() function removes the preemption control data associated with the callingthread.
Theschedctl_start() macro gives a hint to the kernel scheduler that preemptionshould be avoided on the current thread. The pointer passed to themacro must be the same as the pointer returned by the calltoschedctl_init() by the current thread. The behavior of the program when othervalues are passed is undefined.
Theschedctl_stop() macro removes the hint that was set byschedctl_start(). Aswithschedctl_start(), the pointer passed to the macro must be the sameas the pointer returned by the call toschedctl_init() by the current thread.
Theschedctl_start() andschedctl_stop() macros are intended to be used to bracketshort critical sections, such as the time spent holding a spinlock. Otheruses, including the failure to callschedctl_stop() soon after callingschedctl_start(), mightresult in poor performance.
Theschedctl_init() function returns a pointer to aschedctl_t structure if theinitialization was successful, orNULL otherwise. Theschedctl_lookup() function returns a pointerto aschedctl_t structure if the data for that thread was found, orNULL otherwise.
No errors are returned.
Seeattributes(5) for descriptions of the following attributes:
|
priocntl(1),exec(2),fork(2),priocntl(2),attributes(5),threads(5)
Preemption control is intended for use by threads belonging to the time-sharing(TS), interactive (IA), fair-share (FSS), and fixed-priority (FX) scheduling classes. If usedby threads in other scheduling classes, such as real-time (RT), no errorswill be returned butschedctl_start() andschedctl_stop() will not have any effect.
The data used for preemption control are not copied in the childof afork(2). Thus, if a process containing threads using preemption controlcallsfork and the child does not immediately callexec(2), each threadin the child must callschedctl_init() again prior to any future uses ofschedctl_start() andschedctl_stop(). Failure to do so will result in undefined behavior.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |