• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Program

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good evening to all,


any one explain the follow of the program
regards
rex
 
ahmed yehia
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here nothing special is happening, you are creating and starting two threads which run concurrently. Try the below program (added yield()) and notice how threads take turns although output isnt guaranteed in both cases.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic