• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multi threading - concurrently executing two threads

 
kri shan
Ranch Hand
Posts: 1460
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to execute two threads concurrently using multi-threading. Can i just use synchronized (or) synchronized with wait() - when the first thread executes, second thread should wait until first thread finishes its execution?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the point of having two threads if one of them will have to wait until the other is done?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic