1.Next homework will be what kind of strategies we can have for using thread pools
Thread pool can be used to fetch a big amount of file, when there is thousand even million of web page to fetch
, but our computer don’t have the ability to create that much thread, thats the time when thread pool to be use,
simply after fetching an amount of file, the computer will get the next thread from thread pool to keep on running, the advantage of this method is that it can improve the performance of processing these thread ,speeding up the thread load in time.
2.The next question for chapter 4 is why the windows uses one to one mapping for the threads while there are many to many available.
There are some situations in which the one-to-one relationship may improve performance. For our example ,if some columns are rarely used, it may make sense to separate them out into a separate database table that is linked to the original table using a one-to-one relationship. This would reduce the overhead needed to retrieve the columns whenever a query is performed.
3.The third question for chapter 4 is to specify the differences between processes and threads.
The typical difference is that threads (of the same process) run in a shared memory space, while processes run in separate memory spaces.
Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution.
A thread is the entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources. In addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled.