tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Ayers" <danny.ay...@gmail.com>
Subject Can servlets safely spawn threads?
Date Mon, 29 Jan 2007 10:33:19 GMT
Hi,

I would be grateful is someone could answer these questions:

* Can servlets safely spawn threads?
* If so, under what conditions?

I tried to find the answers searching the web, but found conflicting views.
So I thought it worth asking about a specific servlet container
implemention.

I'm trying to make a very simple asynchronous messaging system on top of
HTTP. What I have in mind requires that the servlet called would complete
the request-response in "reasonable" time, yet may initiate other processes
that are potentially long-running. The easiest approach would be to have the
servlet spawning another thread in which to run the other process, and
return a response to the client immediately. But is this possible without
running straight into concurrency breakage?

More background at :

http://dannyayers.com/2007/01/28/a-servlets-problem

Thanks,
Danny.

-- 

http://dannyayers.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message