0

I've been reading about the forbidden Multithreading technique in a servlet. Anyway I don't get the problem, at least in what I was about to try.

I have a long process that needs to be quicker. It has plenty of DB select's (600ms each) to validate some data. I wanted to do concurrently these selects so the data could be validated.

My implementation would create some threads inside the treatment of the request to do the validations concurrently. After the data is validated for each thread (or not validated), after joining all of them to the main thread, I would kill each of these threads and give the answer to the client.

Could you explain me why this is discouraged? Any suggestion?

Thanks!

Andrew Ferrier
  • 13,902
  • 11
  • 40
  • 73
Pahgo
  • 114
  • 6

0 Answers0