• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

will refresh create new thread

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had a doubt that whether pressing Refresh Button will create a new thread or not? i.e suppose if we are trying to access one servlet or jsp page from a server(a thread will be created to look after that) and due to some reason it got delayed.Now if we press Refresh Button what it will do???whether it will recreate the first thread or it kills the first thread and then creates a new thread???
can any one explain clearly what will happen internally???
 
Greenhorn
Posts: 25
MySQL Database PHP Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

For each request there is a new thread, if a user closes the browser, the server isnt aware of that, but, when the serves ends the request, the thread dies.

If you hit refresh, your previous request was canceled, but the first thread will do its job anyway, and will die.
[ February 13, 2008: Message edited by: Jorge Pinho ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ecreate the first thread or it kills the first thread and then creates a new thread???



Actually any modern servlet container uses a pool of Threads to avoid the overhead of creating and destroying them. For example, there is a set of management configuration options in Tomcat:



(from the server.xml config file)

So when a Thread exits the service method, it does not die but is returned to the pool.

Bill
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic