心得分享

Card image cap

高同學 報告/作業 分享經驗 2015/12/17 2015/12/17 OS

2015/12/17 2015/12/17 OS
名稱 2015/12/17 OS
日期 2015/12/17
課程名稱 OS
指導教師 劉艾華

1.What kind of strategies we can have for using thread pools? Name two of them.

Ans: ThreadPool initialize some threads and use in specific times, in order to save time.

ThreadPool can help manage each cycle of the thread, it makes us more concentrate on work, instead of write the code of the thread.


2.Why the windows uses one-to-one mapping for the threads while it has many-to-many available?

Ans: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.Please specify the differences between processes and threads.

Ans:1. A process contain more than one thread.

2. A process is considered as “heavyweight” while a thread is deemed as “lightweight”.

3. Processes are heavily dependent on system resources available while threads require minimal amounts of resource.

4. Modifying a main thread may affect subsequent threads while changes on a parent process will not necessarily affect child processes.

5. Threads are easy to create while processes are not that straightforward.

更新日期:2015/12/18 上午 01:09:40