another solution then would be to keep a pool of


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.

Request for Solution File

Ask an Expert for Answer!!
Operating System: another solution then would be to keep a pool of
Reference No:- TGS0210567

Expected delivery within 24 Hours