문제

My threads operate as a linked list(with overlap, hence threads), implementing something not dissimilar to a timeline. Each condition variable unlocks the next thread in the linked list.

Should I use notify_all() or notify_one() when I have only one to notify?

도움이 되었습니까?

해결책

Use notify_one unless your code makes it easier to read notify_all (for example you've constructed a list which just happens to have one element in it).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top