Thread pools, Operating System

Another solution then would be to keep a pool of threads. Whenever a new task arrives, the system would simply get a thread from pool and set that thread to work on the given task. Whenever the pool is empty, the system blocks until another thread completes its task. One natural question now is: how many threads do we "pre-create" and add to the pool? Ideally, we would want to create an in?nite (or large enough) amount of threads; however, this is clearly not possible, since each thread has a descriptor, a stack, etc, but our main memory is ?nite. Also, beyond a certain point, creatingmore threads does not help anymore, and the server starts to slow down again due to things like paging or lock contention. For example, if we only have 4 CPUs, it doesn't help to try to run a billion things at the same time. In practice, the ?ne-tuning of how many thread to add to the pool for any given application is set empirically, or perhaps adaptively.

Posted Date: 3/13/2013 3:04:22 AM | Location : United States







Related Discussions:- Thread pools, Assignment Help, Ask Question on Thread pools, Get Answer, Expert's Help, Thread pools Discussions

Write discussion on Thread pools
Your posts are moderated
Related Questions
Problem: Managing Outside Communication. a. What is the principal action we use when communicating through a web browser? b. Give an example of how to preaddress an email

Define the Communications Techniques - Application interaction protocols    Communications techniques are well defined. They give developer the programmatic mechanism to transf

Define swapping. A process requires being in memory to be executed. Though a process can be swapped temporarily out of memory to a backing store and then brought back into memo

What are the steps followed in testing? i. Unit testing - The individual components are tested in this type of testing. ii. Module testing - Related collection of independen

Partitions and mounting A disk can be sliced into many partitions, or a partition can span multiple disks. Every partition can be either "raw", having no file system, or "cooke

Question 1: a) Briefly explain each of the following terms: (i) Distributed systems. (ii) Real time systems. (iii) Multiprocessor. b) What is the impo

Define CPU scheduling. CPU scheduling is the method of switching the CPU among several processes. CPU scheduling is the basis of multiprogrammed operating systems. By switching

What are the operations of processes? Process creation A process may create several new processes. The creating process is called as parent process, where as the new proce

Q. Segmentation is alike to paging but uses variable-sized "pages". Describe two segment-replacement algorithms based on FIFO and LRU page replacement schemes. Remember that since

Determine a component of a process precedence sequence Process name, Sequence operator ‘;’ and Concurrency operator ‘,’