1CSCHED(3)                  Common Library Functions                  CSCHED(3)
2
3
4

NAME

6       Csched - LCG Scheduling inferface
7

SYNOPSIS

9       #include <Csched_api.h>
10
11       int Csched_getschedparam(int cid, int *policy, Csched_param_t *param);
12
13       int Csched_setschedparam(int cid, int policy, Csched_param_t *param);
14
15       int Csched_get_priority_min(int policy);
16
17       int Csched_get_priority_mid(int policy);
18
19       int Csched_get_priority_max(int policy);
20
21

ERRORS

23       Beyond  the  errno value, Csched is setting the serrno value to generic
24       values that are described in Cthread(1).
25
26

DESCRIPTION

28       Csched is a common API interface for scheduling of  multithreaded  pro‐
29       grams.
30
31       Csched_getschedparam retrieves the current scheduling policy and prior‐
32       ity of the thread referenced with Cthread's id cid.  The policy can  be
33       CSCHED_OTHER,  CSCHED_FIFO,  CSCHED_RR,  CSCHED_FG_NP  or CSCHED_BG_NP.
34       The param structure contains a member,  named  sched_priority  ,  where
35       will  be  stored the current priority of the thread you ask for. Please
36       read the NOTES section.
37
38       Return value is 0 on success, or -1 on error.
39
40       Csched_setschedparam sets the scheduling policy  and  priority  of  the
41       thread   referenced   with   Cthread's  id  cid.   The  policy  can  be
42       CSCHED_OTHER, CSCHED_FIFO,  CSCHED_RR,  CSCHED_FG_NP  or  CSCHED_BG_NP.
43       You   are   neverthless  warned  that  the  recommended  scheduling  is
44       CSCHED_OTHER.  Trying to use another scheduling is an opendoor to  pro‐
45       cessor  deadlock  if  you  do  not code with extreme care. Furthermore,
46       except CSCHED_OTHER , it is not guaranteed that the other possible val‐
47       ues ( CSCHED_CSCHED_FIFO, CSCHED_RR, CSCHED_FG_NP or CSCHED_BG_NP ) are
48       supported or implemented on your platform.  The  param  structure  con‐
49       tains  a  member, named sched_priority , where is given the priority of
50       the thread you want the attributes to be modified. Its value  can  vary
51       from  Csched_get_priority_min(policy)  to  Csched_get_priority_max(pol‐
52       icy).  Please read the NOTES section.
53
54       Return value is 0 on success, or -1 on error.
55
56       Csched_get_priority_min, Csched_get_priority_mid and  Csched_get_prior‐
57       ity_max  are  returning the minimum, medium and maximum allowed priori‐
58       ties, respectively, vs. the given policy.  The output is the  one  that
59       you  use  in the sched_priority member of the Csched_param_t structure.
60       Please read the NOTES section.
61
62       Return value is != -1 on success, or -1 on error.
63

NOTES

65       About  scheduling,   the   Csched   interface   defines   CSCHED_OTHER,
66       CSCHED_FIFO,  CSCHED_RR,  CSCHED_FG_NP and CSCHED_BG_NP for portability
67       issue. This does not mean that all those schedulings are  supported  on
68       the  platform  you  are running on. In particular, only CSCHED_OTHER is
69       officially supported everywhere.  The  other  scheduling  policies  are
70       totally  system  dependent  and  do not conform to any standardisation.
71       Please be aware, also, that using a scheduling other than  CSCHED_OTHER
72       is an opendoor to processor deadlock...
73
74       Finally,  on some OSes, the scheduling interfaces are not necessarly in
75       the thread library, nor in the C library. In particular, on Digital you
76       may find them in librt, and on Solaris in libposix4.
77
78

SEE ALSO

80       Cthread
81
82

AUTHOR

84       LCG Grid Deployment Team
85
86
87
88LCG          $Date: 2010-04-05 09:51:26 +0200 (Mon, 05 Apr 2010) $   CSCHED(3)
Impressum