I cannot understand the paragraph about "thread". - Minix

This is a discussion on I cannot understand the paragraph about "thread". - Minix ; In Minix book, there is: "In some systems, the operating system is not aware of the threads." "When a thread is about to block, for example, it chooses and starts its successor before stopping." who chooses and starts its successor? ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: I cannot understand the paragraph about "thread".

  1. I cannot understand the paragraph about "thread".

    In Minix book, there is:

    "In some systems, the operating system is not aware of the threads."
    "When a thread is about to block, for example, it chooses and starts
    its successor before stopping."

    who chooses and starts its successor? the process where the thread is
    in? or the interupt procedure.

    I think when a thread is blocked, there must be (or most probably ) a
    interrupt happened, then it is the interrupt handler chosed and start
    its successor?

    the puzzle may be clear if i have read the following sections .

  2. Re: I cannot understand the paragraph about "thread".

    grass wrote:
    > In Minix book, there is:
    >
    > "In some systems, the operating system is not aware of the threads."
    > "When a thread is about to block, for example, it chooses and starts
    > its successor before stopping."
    >
    > who chooses and starts its successor? the process where the thread is
    > in? or the interupt procedure.
    >
    > I think when a thread is blocked, there must be (or most probably ) a
    > interrupt happened, then it is the interrupt handler chosed and start
    > its successor?
    >
    > the puzzle may be clear if i have read the following sections .


    There are at least two different kinds of implementation of threads. In
    Solaris and Linux, a thread is actually a "light weight process" maintained
    by the operating system. What you see as a "process" is a group of threads
    managed as a group by the OS. The second kind of thread is implemented
    within a process by a library - the OS is unaware of these threads. The
    library has a thread management part (often a thread itself) which looks
    after the others. GNU Portable Threads is an example of the second kind of
    implementation.

    If your hardware has multiple CPUs and/or cores, you need light weight
    processes to make the best use of the hardware as the OS can schedule the
    threads over all available cores.

    IIRCC, there are plans to implement light weight processes within Minix3.


    --
    Mel Gibson isn't known for being faithful to the original source.
    His remake of The Life of Brian is rubbish. -- Michael C

  3. Re: I cannot understand the paragraph about "thread".

    Nomen Publicus escreveu:

    > There are at least two different kinds of implementation of threads. In
    > Solaris and Linux, a thread is actually a "light weight process"
    > maintained
    > by the operating system. What you see as a "process" is a group of
    > threads
    > managed as a group by the OS.


    Just one note: does this threads appear in "ps" output as separate
    processes?

    > The second kind of thread is implemented
    > within a process by a library - the OS is unaware of these threads. The
    > library has a thread management part (often a thread itself) which looks
    > after the others. GNU Portable Threads is an example of the second kind of
    > implementation.


    You mean, a library who asks the kernel for a timer and uses this timer to
    preempt the threads?

    --
    João Jerónimo

    "Computer are composed of software, hardware, and other stuff terminated
    in "ware", like firmware, tupperware, (...)" - by JJ.

+ Reply to Thread