l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

address@hidden: Re: thread management]


From: Erik Verbruggen
Subject: address@hidden: Re: thread management]
Date: Tue, 7 Nov 2000 16:07:12 +0100

Woops, forgot to Cc: to the list...

----- Forwarded message from Erik Verbruggen <address@hidden> -----

Date: Tue, 7 Nov 2000 16:06:36 +0100
From: Erik Verbruggen <address@hidden>
To: OKUJI Yoshinori <address@hidden>
Subject: Re: thread management
X-Mailer: Mutt 1.0.1i

On Tue, Nov 07, 2000 at 09:55:44PM +0900, OKUJI Yoshinori wrote:

>   I'm not sure, since I haven't read the source code of Solaris, but
> the paper does mention some hints about them. It says that the
> schedular switches a thread to another when (1) the time slice of
> current thread expires, or (2) current thread waits for a (user-level)
> synchronization object. As each LWP can have its own timer handler,
> (1) was easily implemented in Solaris, and it is trivial to implement
> (2). And, they wrote that in their implementation, it was important to
> make signal handlers re-entrant, so perhaps the schedular is just a
> library function which can be called from both signal handlers and
> ordinary functions, and it can be called from any thread.

Ah, I see. That makes life easy indeed:
 - on user-level thread creation, tell the micro kernel that another thread
   is in the pool (and add it to the pool ofcourse);
 - have the kernel signal the task to reschedule, on L4 this could be:
    - on process creation tell the kernel to run one specific thread,
      which happens to be the user-level thread scheduler,
    - on run, reschedule
 - clean up after each user-level thread exit (notify kernel and remove
   from pool).

I think kernel notification is need, for fair scheduling of the threads.
It might be unnessecary if you assume all kernel threads run for the
same time and reschedule after that time-slice.

This leaves open the question which I couldn't formulate well: how does
the user-land scheduler reschedule threads? I only know classical
single-processor schedulers, which can reschedule all processes easilly
because the scheduler is the only process running. 

Erik.

----- End forwarded message -----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]