心得分享

Card image cap

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

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

1.what kind of strategies we can have for using thread pools?
Create a number of threads at process startup and place them into a pool, where they sit and wait for work.

2.why the windows uses one to one mapping for the threads while there are many to many available.
Because each kernel thread is actually a different kernel-schedulable entity, multiple threads can run concurrently on different processors. It can achieve significant speedups when migrated from uniprocessors to multiprocessors.

3. specify the differences between processes and threads.
process is an executing instance of an application. A thread is a path of execution within a process. Also, a process can contain multiple threads. When you start Word, the operating system creates a process and begins executing the primary thread of that process.
It’s important to note that a thread can do anything a process can do. But since a process can consist of multiple threads, a thread could be considered a ‘lightweight’ process. Thus, the essential difference between a thread and a process is the work that each one is used to accomplish. 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. This allows threads to read from and write to the same data structures and variables, and also facilitates communication between threads.

更新日期:2015/12/17 下午 08:38:26