schedctl_exit man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

schedctl_init(3C)	 Standard C Library Functions	     schedctl_init(3C)

NAME
       schedctl_init,  schedctl_lookup,	 schedctl_exit, schedctl_start, sched‐
       ctl_stop - preemption control

SYNOPSIS
       cc [ flag... ] file...  [ library... ]
       #include <schedctl.h>

       schedctl_t *schedctl_init(void);

       schedctl_t *schedctl_lookup(void);

       void schedctl_exit(void);

       void schedctl_start(schedctl_t *ptr);

       void schedctl_stop(schedctl_t *ptr);

DESCRIPTION
       These functions provide limited control over the scheduling of a thread
       (see  threads(5)).  They	 allow	a running thread to give a hint to the
       kernel that preemptions of that thread  should  be  avoided.  The  most
       likely  use  for these functions is to block preemption while holding a
       spinlock. Improper use of this facility, including  attempts  to	 block
       preemption for sustained periods of time, may result in reduced perfor‐
       mance.

       The schedctl_init() function initializes	 preemption  control  for  the
       calling	thread	and  returns  a	 pointer used to refer to the data. If
       schedctl_init() is called more than once by the same thread,  the  most
       recently returned pointer is the only valid one.

       The  schedctl_lookup() function returns the currently allocated preemp‐
       tion control data associated with the calling thread  that  was	previ‐
       ously returned by schedctl_init(). This can be useful in programs where
       it is difficult to maintain local state for each thread.

       The schedctl_exit() function removes the preemption control data	 asso‐
       ciated with the calling thread.

       The  schedctl_start()  macro  gives a hint to the kernel scheduler that
       preemption should be avoided on the current thread. The pointer	passed
       to  the	macro  must be the same as the pointer returned by the call to
       schedctl_init() by the current thread. The behavior of the program when
       other values are passed is undefined.

       The  schedctl_stop()  macro  removes  the  hint	that was set by sched‐
       ctl_start(). As with schedctl_start(), the pointer passed to the	 macro
       must be the same as the pointer returned by the call to schedctl_init()
       by the current thread.

       The schedctl_start() and schedctl_stop() macros are intended to be used
       to  bracket  short  critical sections, such as the time spent holding a
       spinlock. Other uses, including the  failure  to	 call  schedctl_stop()
       soon after calling schedctl_start(), might result in poor performance.

RETURN VALUES
       The  schedctl_init()  function returns a pointer to a schedctl_t struc‐
       ture if the initialization  was	successful,  or	 NULL  otherwise.  The
       schedctl_lookup()  function returns a pointer to a schedctl_t structure
       if the data for that thread was found, or NULL otherwise.

ERRORS
       No errors are returned.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Stable			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │MT-Level		     │MT-Safe			   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       priocntl(1), exec(2), fork(2), priocntl(2), attributes(5), threads(5)

NOTES
       Preemption control is intended for use  by  threads  belonging  to  the
       time-sharing (TS), interactive (IA), fair-share (FSS), and fixed-prior‐
       ity (FX) scheduling classes. If used by	threads	 in  other  scheduling
       classes,	 such as real-time (RT), no errors will be returned but sched‐
       ctl_start() and schedctl_stop() will not have any effect.

       The data used for preemption control are not copied in the child	 of  a
       fork(2). Thus, if a process containing threads using preemption control
       calls fork and the child does not immediately call exec(2), each thread
       in  the	child must call schedctl_init() again prior to any future uses
       of schedctl_start() and schedctl_stop(). Failure to do so  will	result
       in undefined behavior.

SunOS 5.10			  28 May 2003		     schedctl_init(3C)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net