We help IT Professionals succeed at work.

What's the difference between Barriers and the CountdownEvent?

Paweł
Paweł asked
on
201 Views
Last Modified: 2020-09-18
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.
Comment
Watch Question

Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Commented:
There is a similar question

Click on here to view
CERTIFIED EXPERT

Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: ukerandi (https:#a42818641)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

frankhelk
Experts-Exchange Cleanup Volunteer