multithreading - Java effective implementation of Thread -


I have a file upload functionality, in which the user can upload several files at the same time For good results, I used the thread processing in this way

  thread.start {// do file processing 'due to this it is a long moving process} / Code>  

The problem now is that each file will create a system for a new thread for uploading the system Tie and some other problems, so now I am looking for a solution where I can create a Q to store all the received files and at a time the minimum number of (5 Points can be made) to thread and process it and again create threads and a set of process.

So I am looking for, and soon it does not know what is the efficient way and what is the current best solution

You are looking for a thread pool or - in Java terms - for one:

  Execute Executive = an Exclorator (); Executor.execute (aRunnable ());  

should return a new execute example to executable ) {Return Executor. EnfixTreadpool (42); // just an example ...}


Comments