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
Regard as a computer system that runs 5000 jobs per month with no deadlock-prevention or deadlock-avoidance scheme. Deadlocks take place about twice per month and the operator must

Define lazy swapper. Rather than swapping the entire process into main memory, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be ne


Explain about deadlock prevention? In order for the occurrence of deadlock, the four conditions like mutual exclusion, hold and wait, no pre-emption and  circular wait must hap

Define multithreading The proficiency of an operating system to execute different parts of a program called threads simultaneously is called as multithreading. A thread is a fl


Multithreading - Operating systems that permit different parts of a software program to run concurrently. Operating systems that would come into this category are: Linux UNI

list the prevention of mechanism for race condition with operating system


What is the main advantage of the layered approach to system design? As in all cases of modular design, designing an operating system in a modular way has several benefits. Th