1
votes

I read about threads in some operating system books , and i confuse about the following:

A. Some books when talk about:

  1. many to one relation mean:many threads in user space map to one thread in kernel .
  2. one to one relation mean:one thread in user space map to one thread in kernel
  3. many to many relation mean: some threads in user space multiplex in lower or equal threads in kernel space .

B. On the other hand, some book talk about 4 relations between threads & processes

  1. many to one ,mean:A process defines an address space and dynamic resource ownership. Multiple threads may be created and executed within that process.
  2. one to one ,mean:Each thread of execution is a unique process with its own address space and resources.
  3. one to many ,mean: thread may migrate from one process environment to another. This allows a thread to be easily moved among distinct systems.
  4. many to many ,mean:Combines attributes of (many to one) and (one to many) cases.

The cases in A is clear but in B i didn't understand number 3 , would you please explain it ? Thanks.

2
I think you mean 3rd case in Section B , right ? That is from "Operating system :internals & design principle , 7ed , author : William Stallings) page 170 .Khaled Atteya

2 Answers

1
votes

I am not sure which book you are reading, but it seems to be it was written long time ago and now doesn't have any practical usage. For instance, there is no system I know of which allows thread migration. I doubt there ever was one practically used.

As for user-spaced threads modern systems do not use them. All platforms I know of use threads which are managed by kernel (i.e. kernel threads). All threads within the same process have access to this process memory, but can't go outside of it.

-1
votes

A thread is piece of a process ;while a process is a program in execution mode which requires resources.