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
Q. What are the five main activities of an operating system in regard to process management? Answer: a. The creation as well as deletion of both user and system processes

What is a resource-allocation graph? Deadlocks can be explained more precisely in terms of a directed graph called a system resource allocation graph. This graph having of a se

how response times are reduced by allowing time sharing on top of multiprogramming

Sharing segments between processes without requiring the same segment number is possible in a dynamically linked segmentation system. a. Define a system that permits sta

Write a note on multithreading. Multithreading is the capability of an operating system to execute different parts of a program called as threads, at the same time. The program

Q. Describe the concept of transaction atomicity? Answer: A transaction is a sequence of read as well as writes operations upon some data followed by a commit operation. If the

List three ways of allocating storage, and give advantages of each. a. Contiguous allocation. Fastest, if no changes are to be made. Also simplest for random access files. b

Acyclic-graph directories An acyclic graph permits directories to have shared subdirectories and files. The similar file or subdirectory may be in two dissimilar directories. A

What are the disadvantages of swapping technique used in pre-3BSD UNIX systems? If there is excessively much memory contention, processes are swapped out until sufficient

Q. How Program execute in operating system? Program execution: Operating system loads a program in memory and executes the program. The program should be able to end its exec