心得分享

Card image cap

鄭同學 報告/作業 分享經驗 12/18 12/11 OS作業

12/18 12/11 OS作業
名稱 12/11 OS作業
日期 12/18
課程名稱 作業系統
指導教師 劉艾華

1. What kind of strategies we can have for using thread pools? Name two of them.
(1)Thread pools can help manage each cycle of the thread, it makes us more concentrate on work, instead of write the code of the thread.
(2)Need time to create the thread prior to servicing the request. ThreadPool initialize some threads and use in specific times, in order to saving time.

2. The next question for chapter 4 is why the windows uses one to one mapping for the threads while there are many to many available.
(1)one-to-one model is each user thread maps to a kernel thread and one to one model allows for greater concurrency.
many-to-many model is multiplex many user thread to a smaller or equal number of kernel threads.

3. Please specify the differences between processes and threads.
Processes :
Processes are independent of each other. Threads, since they share the same address space are interdependent.
Process can consist of multiple threads.
Process is considered as “heavyweight”.
There can be more than one thread that may make up a particular process. Instructions may be executed concurrently. However, it will depend on the operating system being used.

Threads:
Threads are easier to create than processes.
Thread is only an execution sequence.
Threads are considered lightweight because they use far less resources than processes.

更新日期:2015/12/20 下午 09:34:22