Link to home
Start Free TrialLog in
Avatar of Paweł
PawełFlag for Switzerland

asked on

What's the difference between Barriers and the CountdownEvent?

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
Avatar of ukerandi
ukerandi
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There is a similar question

Click on here to view
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