Advertisement
codeweekpackage

[IS303] Week 2 Exercise 3

Jan 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Q:What ensures that each thread prints 500 times and does not interfere with the other?
  2. A:The various stacks that each thread maintains ensures that they will always know their progress
  3.  
  4. Q:When does each thread end?
  5. A:Ends at 500
  6.  
  7. Q:When does the program end?
  8. A:Ends when the main method thread ends and garbage collected
  9.  
  10. Q:Is t1.start() blocking? IE: does the main thread wait for t1 to complete before moving on to other code?
  11. A:Nope, it’s asynchronous!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement