Lets take an example of rest webservices. When we define a webservices, in the memory it is created as a singleton, but we are advised not to make the webservices synchronised? Why so?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The authors of the web container went out of their way to make a highly concurrent, highly scalable system that can allow as many simultaneous users as the hardware can handle.
If you go and synchronize the web service, now no matter how fast your server is or how many concurrent connections it can handle, every single users has to wait in line to use your web service one at a time.
That would be considered a pretty big architectural failure for most web services 🙂