473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Servlets Vs CGI....

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
1 3699

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: N.K. | last post by:
Hi, I'm using Tomcat 7.2 and I'm trying to deploy an aplication that uses JSP and servlets. I'm actually trying to duplicate a production server but can't get it right. In the directory...
1
by: Sascha Pohlmann | last post by:
hello, I have the following problem: I would like to evacuate the logic from my jsp files in servlets. servlets provide database contents prepared in HTML tables, the jsp files are supposed...
3
by: Jose Munoz | last post by:
Hi all, I want to share some data for all my applications (servlets and jsps). For this i am using a JSP to set the variables with scope=application. When i get this data from some JSP all is o.k,...
0
by: Ruaan Kruger | last post by:
Hi there, I'm a junior java programmer that has just started working on j2ee. The company I worked for is currently using Struts for all new implementations etc. The problem is however that...
3
by: InterEC.NET | last post by:
Hello, Is there any C++ library or tool that is similar in functionality to what java servlets offer. We run an engineering job search website which is running on a home brewed java servlet...
3
by: Bit Byte | last post by:
I have written a custom servlet engine (and "wrapper" servlets) for some legacy code (C/C++) that I have. The servlets contain the bulk of my 1st 2 layers in a 3 tier architecture - i.e. data...
2
by: prakashsurya | last post by:
gud evening i need a help about servlets its a bit urgent actually the problem i am facing is when i use doGet method i am getting the result in servlets but when i am going for doPost i am...
0
by: ank99 | last post by:
hello...i m trying to run servlets(using GET) from wml page..... using apache tomcat 5.5 server and WinWap for Windows(version 3.2.1.28.)....its working fine as far as just to display wml form...
1
by: ank99 | last post by:
hello...i m trying to run servlets(using GET) from wml page..... web server : apache tomcat 5.5 server WAP Browser: WinWap for Windows(version 3.2.1.28.).... its working fine as far as just to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.