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.