This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: candidate sched.h and sys/sched.h for review


Next try.  I am starting a build with this now so there
might be problems.

Corinna.. SCHED_SPORADIC is now 4.  My concern is
with these constants is that they are sometimes used
in language bindings and we would have to propagate that.
If you don't mind, once this rework is in, I will address
getting us in sync on the other values.

How does it look now?

--joel

On 03/30/2010 09:18 AM, Corinna Vinschen wrote:
On Mar 30 15:46, Ralf Corsepius wrote:
On 03/30/2010 01:58 PM, Joel Sherrill wrote:
On 03/30/2010 03:30 AM, Corinna Vinschen wrote:
#if defined(_POSIX_PRIORITY_SCHEDULING)
/*
* 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252
This is just a formal thingy, but shouldn't new references to the
standard better refer to the latest standard, which would be IEEE
Std 1003.1-2008 at the present time?

I will fix the other issues and resubmit but I don't
have a paper copy of 2008. I agree it would be better.
Do you have a paper copy to get page numbers from
if I put XXX? Or should I delete them?
Why do you need a paper copy?

http://www.opengroup.org/onlinepubs/9699919799/
has everything you need.

http://www.opengroup.org/ had an order form for paper copies, but I
don't now if they sell 9699919799 in "dead wood".
Members of the Open Group also have free access to the document as PDF.
I don't think the pages of the hardcopy are overly important, just a
reference to POSIX-1.2008 and that the functions conform to that standard
is enough, IMHO.

Otherwise, the sched.h header is defined in XBD, chapter 13, the
functions in XSH, chapter 3.  There's no further numbering scheme.

   sched_setparam            p.1803
   sched_getparam            p.1800
   sched_setscheduler        p.1805
   sched_getscheduler        p.1801
   sched_get_priority_max    p.1799
   sched_get_priority_min    p.1799
   sched_rr_get_interval     p.1802
   sched_yield               p.1807

Btw., is there any problem to renumber SCHED_SPORADIC to 4?  If we
ever come around to implement that on Cygwin, we wouldn't have to
add another conditional.  If it is a problem, then, never mind.


Corinna




--
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


/*
 *  Written by Joel Sherrill <joel@OARcorp.com>.
 *
 *  COPYRIGHT (c) 1989-2010.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  Permission to use, copy, modify, and distribute this software for any
 *  purpose without fee is hereby granted, provided that this entire notice
 *  is included in all copies of any software which is or includes a copy
 *  or modification of this software.
 *
 *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
 *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
 *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
 *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
 *
 *  $Id$
 */

#ifndef _SCHED_H_
#define _SCHED_H_

#include <sys/types.h>

#ifdef __cplusplus
extern "C" {
#endif

#if defined(_POSIX_PRIORITY_SCHEDULING)
/*
 *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803
 */
int sched_setparam(
  pid_t                     pid,
  const struct sched_param *param
);

/*
 *  XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800
 */
int sched_getparam(
  pid_t                     pid,
  struct sched_param       *param
);

/*
 *  XBD 13 - Set Scheduling Policy and Scheduling Parameters,
 *         P1003.1b-2008, p. 1805
 */
int sched_setscheduler(
  pid_t                     pid,
  int                       policy,
  const struct sched_param *param
);

/*
 *  XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801
 */
int sched_getscheduler(
  pid_t                     pid
);

/*
 *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799
 */
int sched_get_priority_max(
  int  policy
);

int sched_get_priority_min(
  int  policy
);

/*
 *  XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802
 */
int sched_rr_get_interval(
  pid_t             pid,
  struct timespec  *interval
);
#endif /* _POSIX_PRIORITY_SCHEDULING */

#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING)

/*
 *  XBD 13 - Yield Processor, P1003.1b-2008, p. 1807
 */
int sched_yield( void );

#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */

#ifdef __cplusplus
}
#endif

#endif /* _SCHED_H_ */
/*
 *  Written by Joel Sherrill <joel@OARcorp.com>.
 *
 *  COPYRIGHT (c) 1989-2010.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  Permission to use, copy, modify, and distribute this software for any
 *  purpose without fee is hereby granted, provided that this entire notice
 *  is included in all copies of any software which is or includes a copy
 *  or modification of this software.
 *
 *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
 *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
 *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
 *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
 *
 *  $Id: sched.h,v 1.2 2002/06/20 19:51:24 fitzsim Exp $
 */


#ifndef _SYS_SCHED_H_
#define _SYS_SCHED_H_

#ifdef __cplusplus
extern "C" {
#endif

/* Scheduling Policies */
/* Open Group Specifications Issue 6 */
#if defined(__CYGWIN__)
#define SCHED_OTHER    3
#else
#define SCHED_OTHER    0
#endif

#define SCHED_FIFO     1
#define SCHED_RR       2

#if defined(_POSIX_SPORADIC_SERVER)
#define SCHED_SPORADIC 4
#endif

/* Scheduling Parameters */
/* Open Group Specifications Issue 6 */

struct sched_param {
  int sched_priority;           /* Process execution scheduling priority */

#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER)
  int sched_ss_low_priority;    /* Low scheduling priority for sporadic */
                                /*   server */
  struct timespec sched_ss_repl_period;
                                /* Replenishment period for sporadic server */
  struct timespec sched_ss_init_budget;
                               /* Initial budget for sporadic server */
  int sched_ss_max_repl;       /* Maximum pending replenishments for */
                               /* sporadic server */
#endif
};

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]