By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,989 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

Servlets Vs CGI....

P: n/a
Probably a simple question...
I understand that in the Servlet multithreaded model a new thread(a
lightweight process) is created for every request as opposed to CGI
where a new process is created for every request. Now one has the
option of implementing the Servlet as a SingleThreaded module too, in
which case a seperate Servlet instance is created for every request.
My question is why would one want to do this i.e when & under what
conditions would one implement a singlethreaded servlet model as
opposed to the default multithreaded one ?
Looking forward to your responses.

Thanks,
-MK.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"pentium77" <nm******@yahoo.com> wrote in message
news:7a**************************@posting.google.c om...
Probably a simple question...
I understand that in the Servlet multithreaded model a new thread(a
lightweight process) is created for every request as opposed to CGI
where a new process is created for every request. Now one has the
option of implementing the Servlet as a SingleThreaded module too, in
which case a seperate Servlet instance is created for every request.
My question is why would one want to do this i.e when & under what
conditions would one implement a singlethreaded servlet model as
opposed to the default multithreaded one ?
Looking forward to your responses.

Thanks,
-MK.


The practice of implementing SingleThreadModel in a servlet (which is
probably what you mean) is a deprecated one. Mutithreading can cause heaps
of synchronization issues and SingleThreadModel was a bad way of
circumventing these. Servlet implementers should synchronize on a much more
finegrained level, Java offers plenty support for that.

Silvio Bierman
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.