[Top][All Lists]

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

Re: address@hidden: Re: thread management]

From: OKUJI Yoshinori
Subject: Re: address@hidden: Re: thread management]
Date: Wed, 08 Nov 2000 04:22:47 +0900

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

> 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.

  I thought of the same thing... This may be a disadvantage in
L4. However, if you don't need a fine-grain time slice, it is easily
simulated in a user-level schedular. For example:

1. Run a schedular thread in each task.
2. The schedular thread blocks until a time slice expires by a null
ipc. This time slice could be long (e.g. one second).
3. When the schedular thread wakes up, it checks if there is a thread
which runs too long by l4_thread_ex_regs.
4. If there is such a thread, it has the thread switch to another
(user-level) thread.

This scenario is not good enough for real-time applications, but
real-time applications can still use one kernel thread per user
thread, and can request hardware timer interrupts, anyway.

NOTE: at the moment, neither Fiasco nor L4-KA has fully implemented
l4_thread_ex_regs. Uggh.

> 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. 

  That's not very different between MP and UP. The kernel provides a
system call to manipulate a thread, and the synchronization is
guaranteed by the kernel. But, of course, the best algorithm in UP is
not always the best in MP.


reply via email to

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