Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How multi processing is achieved in JAVA?

Answer Posted / rajashree

A thread pool is a collection of threads, which you
keep "alive" and use/reuse to process incoming "tasks".
When a new tasks arrives (a typical example is a request to
an HTTP server) you try to find a thread from the
collection, which is idle, and handle the task to it. If no
such thread exists you either wait for one to become
available or add a new thread to the pool (usually there is
an upper limit, though). After the thread has finished
processing the task, it is not terminated, only marked as
idle and ready to be reused for another task.

The main advantages of using a thread pool as opposed to
creating a new thread to handle each new task are:

1) By reusing threads you save the thread
creation/destruction overhead.

2) You have control over the maximum number of tasks that
are being processed in parallel (= number of threads in the
pool).

Is This Answer Correct ?    8 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

placement papaers of spring computing technology

1359


Is main is a keyword?

945


Difference between overriding and overloading in java?

1005


What is arrays aslist in java?

916


Can we have two main methods in a java class?

989


What is the difference between private & public & friendly classes?

1015


Does java map allow duplicates?

838


How does hashmap work in java ?

984


Can list have duplicates in java?

854


What is meant by object oriented programming – oop?

921


Explain different ways of creating a thread. Which one would you prefer and why?

979


Define interface in java?

1022


What are recursive functions?

983


What is the access scope of a protected method?

953


What do you mean by stream pipelining in java 8?

1154