Skip to content

Barrier can be easily misconfigured  #26

@Heiss

Description

@Heiss

let mut barrier = Barrier::new(2, "barrier_test_notleader", client);

You have to configure the same number in all constructors, which is easily to be made an error and not very user-friendly. Think about another approach.

Maybe can be set only from first barrier or only leader. Otherwise ignored.
Problem is, that you not know, which code will be executed first, so any use needs to set a barrier. The first init sets the leader and the limit for all others.

Other solution could be: If there are 2 different values for waiting clients, it results in an error in wait statement, because this is the first call or a check in init. Could be okay, because only a one-time check.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions