• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Death of a thread

 
Deepali Pate
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Death of a thread can occur
When exception is thrown
System.exit(0) is called
and run() ends
are all these satements true.
Threads have parent-child relationship is this true or false
 
Amir Ghahrai
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are all true,
since once you call System.exit(0), it terminates the execution of the main thread from which your child threads have been spawned, therefore they die too.
all threads that have been spawned from the main thread, they inherit the main thread priority, therefore there is a relation between parent and child thread.
HTH
 
Deepali Pate
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This ? at this link.
http://www.tipsmart.com/studytools/selfreview/threads.htm
Q10. State which of the following statements are True.
(1) Concurrent Java programs can exhibit deterministic behavior, by providing mechanisms for synchronizing.
(2) Threads have parent-child relationships.
(3) When the thread is created, it is not yet active
SKIP THE QUESTION
1 and 3
All 3
1 and 2
Deepali
gives answer is is 1 and 3 when i think all 3 are true.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic