Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7865893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:13:19+00:00 2026-06-03T00:13:19+00:00

What is the difference between CyclicBarrier and CountDownLatch? I thnik there is subtle difference,

  • 0

What is the difference between CyclicBarrier and CountDownLatch? I thnik there is subtle difference, as both looks same.

Please let me know if I am wrong and also explain same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:13:20+00:00Added an answer on June 3, 2026 at 12:13 am

    A CountDownLatch is used for one-time synchronization. While using a CountDownLatch, any thread is allowed to call countDown() as many times as they like. Threads which called await() are blocked until the count reaches zero because of calls to countDown() by other unblocked threads. The javadoc for CountDownLatch states:

    The await methods block until the current count reaches zero due to
    invocations of the countDown() method, after which all waiting threads
    are released and any subsequent invocations of await return
    immediately.
    …

    Another typical usage would be to divide a problem into N parts,
    describe each part with a Runnable that executes that portion and
    counts down on the latch, and queue all the Runnables to an Executor.
    When all sub-parts are complete, the coordinating thread will be able
    to pass through await. (When threads must repeatedly count down in
    this way, instead use a CyclicBarrier.)

    In contrast, the cyclic barrier is used for multiple sychronization points, e.g. if a set of threads are running a loop/phased computation and need to synchronize before starting the next iteration/phase. As per the javadoc for CyclicBarrier:

    The barrier is called cyclic because it can be re-used after the
    waiting threads are released.

    Unlike the CountDownLatch, each call to await() belongs to some phase and can cause the thread to block until all parties belonging to that phase have invoked await(). There is no explicit countDown() operation supported by the CyclicBarrier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between XmlArrayAttribute and XmlArrayItemAttribute? Please explain both sides (i.e. serialzing
is there a difference between a struct in c++ and a struct in c#?
Difference between Map and Properties as both have key-value pair.
A difference between a destructor (of course also the constructor) and other member functions
Is there any difference between: <img src=http://www.foo.com/bar.jpg /> and <img src=/bar.jpg /> ? Is
Is there a performance difference between String.Replace(char, char) and String.Replace(string, string) when I just
I know the difference between smallDateTime and timeStamp. Right now I am using smallDateTime
Is there any practical difference between a Set and Collection in Java, besides the
//Difference between 2 dates This function works well but display wrong time format. Pls
What is the difference between element.css('visibility', 'visible') and element.show() . Also, what is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.