DragonFly kernel List (threaded) for 2007-02
DragonFly BSD
DragonFly kernel List (threaded) for 2007-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [PATCH] 1:1 Userland threading stage 2.11/4:

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 4 Feb 2007 11:50:19 -0800 (PST)

:hm.  first I thought that the kernel will upcall into userland as soon as=
: there is a signal, but it seems that only happens on task switches?

    It happens immediately, but it isn't quite so easy to implement
    because the process may not actually be running at the time.  If
    the process *IS* running on a cpu an AST trap is created in order
    to interrupt the process, then the doreti/userret code handles the
    signal.  If the process is not running on a cpu the signal will
    wake the process up and the signal will be handled when that process
    switches back in (it will be in kernel mode at that point), and then
    handled in the doreti/userret code.

:another thing is that if all LWPs are sleeping in the kernel and some of =
:these sleeps are interruptible, one of these LWPs has to receive the sign=
:al by interrupting the sleep.  so in any case we will have to run down th=
:e list.  on the other hand, signals don't happen that often.
:with this patch the LWPs will already check both signal sets.
:  simon

    Hmm.  What does POSIX say about which thread should get interrupted?

					Matthew Dillon 

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