1. are the people out there use the same way im using now (servlet + rmi + multithread)?
2. is my method of combining the servlet + RMI + multithreading good for my system
Ajay Saxena wrote:
However,the solution is far from complete as you want the response to be generated when one of the threads is done with its job.
In the current implementation the three threads are being spawned by the parent thread and it's not blocking on the child threads.
Designing a solution where you would like the parent thread to block only till ONE of the threads is done,and then probably interrupt the remaining threads would be tricky.
puts the parent thread in a busy wait wasting CPU resources.Whenever this thread is scheduled by the OS(assuming the JVM uses native threads),the former does nothing but polls the completion status of the two DA threads.
Ajay Saxena wrote:You are very close to the solution!
(i think the || operator should be changed to &&):
Catch Ernie! Catch the egg! And catch this tiny ad too:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earthhttps://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter