Servlets Vs CGI....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pentium77

    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.
  • Silvio Bierman

    #2
    Re: Servlets Vs CGI....


    "pentium77" <nmadanku@yahoo .com> wrote in message
    news:7a449ecc.0 407150930.671e6 bd4@posting.goo gle.com...[color=blue]
    > 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.[/color]

    The practice of implementing SingleThreadMod el in a servlet (which is
    probably what you mean) is a deprecated one. Mutithreading can cause heaps
    of synchronization issues and SingleThreadMod el 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


    Comment

    Working...