• Post Reply Bookmark Topic Watch Topic
  • New Topic

CyclicBarrier issue.  RSS feed

 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried this CyclicBarrier example and looks like Second Thread is not working completing after barrier.await() call ?

Is there something else happening, because I can see that JVM is still running but the last sysout statement in run() of the SeriveTwo class is not displayed in the console ?


 
Henry Wong
author
Sheriff
Posts: 23291
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As an FYI, you have configured the barrier to allow two threads through, but you have three threads trying to get through (the third thread is the main thread).

Henry
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry, Thanks for quick help ..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!