12/18 OS作業

名稱
OS作業
描述
OS作業
日期
12/18
課程名稱
作業系統
指導教師
劉艾華
心得
(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 saving time.

ThreadPool can help manage each cycle of the thread, it makes us can be more concentrate to work, and no 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 can 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 within a process communicate directly while processes do not communicate so easily.

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