Information Technology Reference
In-Depth Information
reach a wait state. So, if we have 10 users invoking processes with a task as the first step
that takes 2 seconds to process, we will have 10 threads hung up for 2 seconds each.
With the executor service, this is far more manageable, because passing tasks to the ex-
ecutor service takes barely any time, and it will queue tasks for deferred execution until a
thread inside its pool is made available. This translates to a far more scalable situation for
our previous case, because we will have 10 threads hung up for very few milliseconds (the
time it takes to queue a task), and then a limited number of threads solving elements from
that queue. The following diagram shows how a server that uses the executor service (at
the bottom of the diagram) scales better on high concurrency situations than the one that
solves tasks using a synchronous work item handler (at the top of the diagram):
Search WWH ::




Custom Search