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.