心得分享

Card image cap

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

12/11 OS作業
名稱 12/11 OS作業
描述 OS
課程名稱 作業系統
指導教師 劉艾華

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) Thread pools initialize some threads and use in specific times, in order to save 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.

In one to one model, the OS is aware of each thread and can schedule another if a particular thread blocks. The OS is unable to do this in the many-to-many model.

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

Here’s a summary of the differences between threads and processes:
(1) Threads are easier to create than processes since they don't require a separate address space.
(2) Multithreading requires careful programming since threads share data structure that should only be modified by one thread at a time. Unlike threads, processes don't share the same address space.
(3) Threads are considered lightweight because they use far less resources than processes.
(4) Processes are independent of each other. Threads, since they share the same address space are interdependent, so caution must be taken so that different threads don't step on each other. This is really another way of stating above.
(5) A process can consist of multiple threads.

更新日期:2015/12/18 上午 01:17:24