/sys$common/syshlp/helplib.hlb
DCE_THREADS, Application Routines, pthread_setprio

 *Conan The Librarian (sorry for the slow response - running on an old VAX)

  NAME

      pthread_setprio - Changes the current priority of a thread

  SYNOPSIS

      #include <pthread.h>

      int pthread_setprio( pthread_t thread,
                           int       priority );

  PARAMETERS

      thread              Thread whose priority is changed.

      priority            New priority value of the thread specified
                          in thread.  The priority value depends on
                          scheduling policy. Valid values fall within
                          one of the following ranges:

                          o    PRI_OTHER_MIN <= priority <= PRI_OTHER_MAX

                          o    PRI_FIFO_MIN <= priority <= PRI_FIFO_MAX

                          o    PRI_RR_MIN <= priority <= PRI_RR_MAX

                          o    PRI_FG_MIN_NP <= priority <= PRI_FG_MAX_NP

                          o    PRI_BG_MIN_NP <= priority <= PRI_BG_MAX_NP

  If you create a new  thread  without  specifying  a  threads  attributes
  object  that contains a changed priority attribute, the default priority
  of the newly created thread is the midpoint  between  PRI_OTHER_MIN  and
  PRI_OTHER_MAX  (the midpoint between the minimum and the maximum for the
  SCHED_OTHER policy).

  When you call this routine to specify a minimum or maximum priority, use
  the  appropriate  symbol;  for example, PRI_FIFO_MIN or PRI_FIFO_MAX. To
  specify a value between the minimum  and  maximum,  use  an  appropriate
  arithmetic expression. For example, to specify a priority midway between
  the minimum and maximum for the Round Robin scheduling  policy,  specify
  the following concept using your programming language's syntax:
  pri_rr_mid = (PRI_RR_MIN + PRI_RR_MAX)/2

  If your expression results in a value outside the range  of  minimum  to
  maximum, an error results when you use it.

  DESCRIPTION

  The pthread_setprio() routine changes the current priority of a  thread.
  A  thread  can  change its own priority using the identifier returned by
  pthread_self().

  Changing the priority of a thread can cause it to start executing or  be
  preempted  by  another  thread. The effect of setting different priority
  values depends on the scheduling priority assigned to  the  thread.  The
  initial scheduling priority is set by calling the pthread_attr_setprio()
  routine.

  Note that pthread_attr_setprio() sets the  priority  attribute  that  is
  used to establish the priority of a new thread when it is created.  How-
  ever, pthread_setprio() changes the priority of an existing thread.

  RETURN VALUES

  If successful, this routine returns the previous priority.

  If the function fails, errno may be set to one of the following values:

    Return              Error       Description
    ___________________________________________________________
    Previous priority               Successful completion.

    -1                 [EINVAL]     The value specified by thread is invalid.

    -1                 [ENOTSUP]    An attempt is made to set the  policy to
                                    an unsupported value.

    -1                 [ESRCH]      The value specified by thread does not
                                    refer to an existing thread.

    -1                 [EPERM]      The caller does not have the appropriate
                                    privileges  to  set  the  priority of
                                    the specified thread.

  RELATED INFORMATION

      FUNCTIONS:  pthread_attr_setprio
                  pthread_attr_setsched
                  pthread_create
                  pthread_self
                  pthread_setscheduler
  Close     HLB-list     TLB-list     Help  

[legal] [privacy] [GNU] [policy] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.