心得分享

Card image cap

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

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

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

Ans:Creating new threads every time one is needed and then deleting it when it is done can be inefficient, and can also lead to a very large ( unlimited ) number of threads being created.
An alternative solution is to create a number of threads when the process first starts, and put those threads into a thread pool.
Threads are allocated from the pool as needed, and returned to the pool when no longer needed.
When no threads are available in the pool, the process may have to wait until one becomes available
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.
To specify the differences between processes and threads

Ans:Threads are used for small tasks, whereas processes are used for more ‘heavyweight’ tasks – basically the execution of applications.
Another difference between a thread and a process is that threads within the same process share the same address space, whereas different processes do not.

更新日期:2015/12/17 下午 06:38:54