I have the following question:
if inside doPost method of a servet i create some local variables and pass them to static method of another class which use them and returns something...what happens when multiple thread access the doPost method, create local variables and pass thouse variables to the static method?
Is it thread safe?
Parameters are passed, and local variable created, on the stack, of which every thread has its own. So they are threadsafe.
Of course, the objects they point to may be shared and pose thread synchronization issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With