wood burning stoves 2.0*
The moose likes Servlets and the fly likes Spawning multiple threads inside a Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Spawning multiple threads inside a Servlet" Watch "Spawning multiple threads inside a Servlet" New topic
Author

Spawning multiple threads inside a Servlet

Sheenu Pillai
Greenhorn

Joined: Jul 25, 2002
Posts: 15
Hi All,

We have a situtation where we need to crawl various sites/databases for information to perform a search. The most efficient way is to multithread the application as we all know. Since J2EE discourages custom Multithreading, we had to search for alternatives to accomplish this task.

We came across few interesting solutions using JMS/MDB. Other than using these is there a simpler way to accomplish this. Any help is appreciated...

Thanks,
Srini
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61232
    
  66

What's the tie-in to Servlets?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sheenu Pillai
Greenhorn

Joined: Jul 25, 2002
Posts: 15
The search request comes from a JSP to the servlet...
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Did you consider concurrent package in JDK 1.5 and above? I use it in application similar what you described. Check last link in my signature.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Sheenu Pillai
Greenhorn

Joined: Jul 25, 2002
Posts: 15
Thanks Dema, But we are using Jdk1.4 and do not have the option to upgrade to 1.5 (atleast for now)... Is there a 3rd party package I could use similar to the package available in Jdk1.5
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
There is a backport of concurrent package and we use it with a great success on JDk 1.4.
Use JSR166 backport version from:
http://www.mathcs.emory.edu/dcl/util/backport-util-concurrent/
Sheenu Pillai
Greenhorn

Joined: Jul 25, 2002
Posts: 15
Appreciate your help... I will have a look at it...
 
 
subject: Spawning multiple threads inside a Servlet