Alex, you can specify in the web.xml for the servlet to autoload when 
the container starts, and then start the threads in the init method.  To 
track your threads, first create a threadgroup, and start all your 
threads in that group.  Name each one, and then use a tool like 
OptimizeIt to track them.  OptimizeIt attaches nicely to a jrun 
container.  Be careful starting too many threads, you'll shoot yourself. 
 Most people don't realize they don't need 'em :)  Hope that helps, BenG.

RESTREPO, ALEXANDER G [Non-Pharmacia/1000] wrote:

>Hello:
>
>Does anyone have an example
>of a servlet which starts several threads
>in the background?
>
>I would also be interested in seeing how 
>I can monitor the threads the servlet
>starts. 
>
>For example let's say
>I have a LoadDatabaseServlet which starts
>5 threads.  
>
>The 5 threads are:
>
>1.  LoadEmployeeTableThread
>2.  LoadCountyTableThread
>3.  LoadZipTableThread
>4.  LoadAreaCodeTableThread
>5.  LoadPopulationTableThread
>
>I would like to monitor the status of
>the threads via the same servlet which starts
>the threads.  
>
>The status would be in the form:
>
>LoadEmployeeTableThread   has processed 121 records
>LoadCountyTableThread     has processed 131 records
>LoadZipTableThread        has processed 141 records
>LoadAreaCodeTableThread   has processed 151 records
>LoadPopulationTableThread has processed 161 records
>
>Once the threads are done the status would be:
>
>LoadEmployeeTableThread   is done processing
>LoadCountyTableThread     is done processing
>LoadZipTableThread        has processed 141 records
>LoadAreaCodeTableThread   has processed 151 records
>LoadPopulationTableThread has processed 161 records
>
>
>Any help would be greatly appreciated,
>
>Alex Restrepo
>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to