troubleshooting Question

What's the difference between Barriers and the CountdownEvent?

Avatar of Paweł
PawełFlag for Switzerland asked on
C#
3 Comments1 Solution213 ViewsLast Modified:
I've been looking at the differences between the Barrrier and CountdownEvent signalling classes in c#; i see slight differences:
  • Barrier can be instantiated with a post phase action: var barrier = new Barrier(5, b=>{ });
  • Barrier can call SignalAndWait after it's signaled down to 0 to reset itself, whereas using the countdownEvent reset has to be explicitly called

However I'm having a hard time seeing a clear advantage of using one over the other?
please share your thoughts or experiences as to why choose one over the other?

to me it just seems like a matter of preference, I mean the Barrier seems more appropriate if you're going to go through multiple iterations, but just barely.
ASKER CERTIFIED SOLUTION
ukerandi

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros