12/18 OS作業

名稱
OS作業
日期
12/18
課程名稱
作業系統
指導教師
劉艾華
心得
1.What kind of strategies we can have for using thread pools? Name two of them.

Ans: When a server receives a request, it awakens a thread form this pool─if one is available─and passes it the request for service.Once the thread completes its service,it returns to the pool and awaits more work.If the pool contains no available thread,the server waits until one becomes free.
Apple’s Grand Central Dispatch and Windows API.


2.Why the windows uses one to one mapping for the threads while there are many to many available?

Ans:Each user-level thread maps to a kernel thread.Also allows multiple threads to run in parallel on multiprocessor.Also allowing another thread to run when a thread makes a blocking system call.


3.The third question for chapter 4 is to specify the differences between processes and threads.

Ans:Both processes and threads are independent sequences of execution. The typical difference is that threads (of the same process) run in a shared memory space, while processes run in separate memory spaces.