-
Theadpool
-
Task Executor
-
Request
-
Linked List Queue
ThreadPool class creating fixed number of threads and runs TaskExecutor. New requests will be queued to the Linked List Queue and Threads are handling the requests accordingly
Multi threaded client program
Client -sh startClient.sh {PORT} {numberOfClients}
Ex :sh startClient.sh 20
Server -sh startServer.sh {serverPort} {queueSize} {numberOfThreads} {RequestWaitTimeOnServer}
Ex:- sh startServer.sh 9000 10 5 1
RequestWaitTimeOnServer - if this parameter is not 0 it will sleep the request task for number of seconds.
http://tutorials.jenkov.com/java-concurrency/thread-pools.html
http://tutorials.jenkov.com/java-multithreaded-servers/thread-pooled-server.html
http://www.makeinjava.com/custom-thread-pool-example-without-using-executor-framework/
http://oppansource.com/implementing-own-thread-pool-in-java/