• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding the Usage of the Thread.join  RSS feed

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have read the docs regarding the Usage of the Thread.join method??

Can i use this functionality in my web application scenario ? Because there every request will be a Thread as there will be no SystemThread or a MainThread .
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends entirely on what Thread you want to .join() with.

Perhaps tell us more about what you want to do and why you think join() is needed/the right solution and we can help you achieve what you want.

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be frank i don't have any scenario. you can think it as a general query

Hope you reply and help if you know the answer
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a general rule, you can use .join() on any thread, and this would include the ones available in a Web App. But Web Apps can be touchy things, and I would suggest only using it on Threads that you create manually, for example if you have a few background threads you create to process data, then want the container-generated request thread to .join() them before building a response.

You probably never want to .join() any threads generated by the container.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!