Wednesday, 25 January 2017

How can you ensure the execution sequence of threads ?


Use join()

  • Start from T3
  • Call join() so that it calls T2
  • Inside T2, call join() again so that it calls T1


By this way, the execution sequence would be T1 -> T2 -> T3

No comments:

Post a Comment

Note: only a member of this blog may post a comment.