Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jul 2001 16:48:02 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        arch@FreeBSD.ORG
Subject:   Re: thread scheduling question
Message-ID:  <Pine.SUN.3.91.1010731163310.14566A-100000@pcnet1.pcnet.com>
In-Reply-To: <Pine.BSF.4.21.0107311525440.35786-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 31 Jul 2001, Julian Elischer wrote:
> Does anyone have any views on what happens when
> the posix scheduling calls are applied against a multithreaded
> process?

What POSIX scheduling calls?  sched_xxx?

> in particular against one with several KSEGRPs?
> are the multiple KSEs and KSEGRPs visible to the outside at all?

In general, I think that the sched_xxx (say, sched_setscheduler)
should apply to the process' main (original) KSE Group and not
affect other KSE Groups created for scope system threads.  We'll
have another system call (perhaps later on) to allow changing of
those KSE Groups (Solaris has priocntl(2) to allow changing scheduling
parameters by PID, LWPID, PPID, PGID, etc).

Here's what Solaris 8 has to say about sched_setscheduler (and it's
mostly verbatim from what SUSv2 has to say):

  The effect of this function on individual threads is  depen-
  dent on the scheduling contention scope of the threads:

     o  For threads with system scheduling  contention  scope,
        these functions have no effect on their scheduling.

     o  For threads with process scheduling contention  scope,
        the   threads'   scheduling  parameters  will  not  be
        affected. However, the  scheduling  of  these  threads
        with  respect  to  threads  in  other processes may be
        dependent on the scheduling parameters of  their  pro-
        cess, which are governed using these functions.

  If an implementation supports a two-level  scheduling  model
  in  which  library threads are multiplexed on top of several
  kernel  scheduled  entities,  then  the  underlying   kernel
  scheduled  entities  for the system contention scope threads
  will not be affected by these functions.

  The underlying kernel scheduled  entities  for  the  process
  contention  scope threads will have their scheduling parame-
  ters  changed  to  the  value  specified  in  param.  Kernel
  scheduled  entities  for  use  by  process  contention scope
  threads that are created after this call  completes  inherit
  their scheduling policy and associated scheduling parameters
  from the process.

  This function is not atomic with respect to other threads in
  the  process.  Threads  are  allowed  to continue to execute
  while this function call is in the process of  changing  the
  scheduling  policy for the underlying kernel scheduled enti-
  ties used by the process contention scope threads.


-- 
Dan Eischen

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.1010731163310.14566A-100000>