This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threads

 
Amudha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should the main thread be the last to be executed as few books say.What would happen if my main thread was not the last thread that was executed
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Executed or started?
Think of Java as a multi-threaded environment. If thread A starts thread B and then thread A ends, thread B may still be executing. No problem.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amudha:
Should the main thread be the last to be executed as few books say.What would happen if my main thread was not the last thread that was executed

it totaly depends on operating system if u r woorking in Windows Environment ,there is no problem but if ur working other os than it may problem becoz it terminates the child thread as soon as main thread exits and that may lead to file coorupted,data corruption on which ur child thread is operating on.So it is always advisable to use Join() .
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!