Csched man page

CSCHED(3)                  Common Library Functions                  CSCHED(3)

[1mNAME[0m
      [1mCsched [22m- [1mLCG Scheduling [22minferface

[1mSYNOPSIS[0m
      [1m#include <Csched_api.h>[0m

      [1mint Csched_getschedparam(int [4m[22mcid[24m[1m, int *[4m[22mpolicy[24m[1m, Csched_param_t *[4m[22mparam[24m[1m);[0m

      [1mint Csched_setschedparam(int [4m[22mcid[24m[1m, int [4m[22mpolicy[24m[1m, Csched_param_t *[4m[22mparam[24m[1m);[0m

      [1mint Csched_get_priority_min(int [4m[22mpolicy[24m[1m);[0m

      [1mint Csched_get_priority_mid(int [4m[22mpolicy[24m[1m);[0m

      [1mint Csched_get_priority_max(int [4m[22mpolicy[24m[1m);[0m

[1mERRORS[0m
      Beyond  the  errno value, [1mCsched [22mis setting the serrno value to generic
      values that are described in [1mCthread[22m(1).

[1mDESCRIPTION[0m
      [1mCsched [22mis a common API interface for scheduling of  multithreaded  pro-
      grams.

      [1mCsched_getschedparam [22mretrieves the current scheduling policy and prior-
      ity of the thread referenced with Cthread's id [4mcid.[24m  The [4mpolicy[24m can  be
      [4mCSCHED_OTHER,[24m  [4mCSCHED_FIFO,[24m  [4mCSCHED_RR,[24m  [4mCSCHED_FG_NP[24m  or [4mCSCHED_BG_NP.[0m
      The [4mparam[24m structure contains a member,  named  [4msched_priority[24m  ,  where
      will  be  stored the current priority of the thread you ask for. Please
      read the [1mNOTES [22msection.

      Return value is 0 on success, or -1 on error.

      [1mCsched_setschedparam [22msets the scheduling policy  and  priority  of  the
      thread   referenced   with   Cthread's  id  [4mcid.[24m   The  [4mpolicy[24m  can  be
      [4mCSCHED_OTHER,[24m [4mCSCHED_FIFO,[24m  [4mCSCHED_RR,[24m  [4mCSCHED_FG_NP[24m  or  [4mCSCHED_BG_NP.[0m
      You   are   neverthless  [1mwarned  [22mthat  the  [1mrecommended  [22mscheduling  is
      [4mCSCHED_OTHER.[24m  Trying to use another scheduling is an opendoor to  pro-
      cessor  deadlock  if  you  do  not code with extreme care. Furthermore,
      except [4mCSCHED_OTHER[24m , it is [1mnot [22mguaranteed that the other possible val-
      ues ( [4mCSCHED_CSCHED_FIFO,[24m [4mCSCHED_RR,[24m [4mCSCHED_FG_NP[24m or [4mCSCHED_BG_NP[24m ) are
      supported or implemented on your platform.  The  [4mparam[24m  structure  con-
      tains  a  member, named [4msched_priority[24m , where is given the priority of
      the thread you want the attributes to be modified. Its value  can  vary
      from  [1mCsched_get_priority_min([4m[22mpolicy[24m[1m)  [22mto  [1mCsched_get_priority_max([4m[22mpol-[0m
      [4micy[24m[1m).  [22mPlease read the [1mNOTES [22msection.

      Return value is 0 on success, or -1 on error.

      [1mCsched_get_priority_min[22m, [1mCsched_get_priority_mid [22mand  [1mCsched_get_prior-[0m
      [1mity_max  are  returning the minimum, medium and maximum allowed priori-[0m
      [1mties, respectively, vs. the given [4m[22mpolicy.[24m  The output is the  one  that
      you  use  in the [4msched_priority[24m member of the Csched_param_t structure.
      Please read the [1mNOTES [22msection.

      Return value is != -1 on success, or -1 on error.

[1mNOTES[0m
      About  scheduling,   the   Csched   interface   defines   [4mCSCHED_OTHER,[0m
      [4mCSCHED_FIFO,[24m  [4mCSCHED_RR,[24m  [4mCSCHED_FG_NP[24m and [4mCSCHED_BG_NP[24m for portability
      issue. This does [1mnot [22mmean that all those schedulings are  supported  on
      the  platform  you  are running on. In particular, only [4mCSCHED_OTHER[24m is
      officially supported everywhere.  The  other  scheduling  policies  are
      totally  system  dependent  and  do not conform to any standardisation.
      Please be aware, also, that using a scheduling other than  [4mCSCHED_OTHER[0m
      is an opendoor to processor deadlock...

      Finally,  on some OSes, the scheduling interfaces are not necessarly in
      the thread library, nor in the C library. In particular, on Digital you
      may find them in librt, and on Solaris in libposix4.

[1mSEE ALSO[0m
      [1mCthread[0m

[1mAUTHOR[0m
      [1mLCG Grid Deployment [22mTeam

LCG          $Date: 2010-04-05 09:51:26 +0200 (Mon, 05 Apr 2010) $   CSCHED(3)