C++ Logo

std-discussion

Advanced search

Re: Atomic notify may get missed by atomic wait

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Fri, 22 Jul 2022 12:41:25 +0200
pt., 22 lip 2022 o 03:48 Thiago Macieira via Std-Discussion
<std-discussion_at_[hidden]> napisaƂ(a):
>
> On Thursday, 21 July 2022 10:26:49 PDT zwhconst via Std-Discussion wrote:
> > So it seems to me that the current wording does not guarantee the
> > termination
> > of the above code, so as the original code in the other mailing thread.
>
> Then please write a paper to firm the wording up.
>

But what should be added to fix it?
Would be enough text like:
"notify guarantee that current value is visible in all threads before
unblocking"

Will this be a correct solution?

Another observation is `notify_all` does have a guarantee in current
text to terminate correctly?
As when another thread load old value it is still eligible to unlock
even if it was already unlocked by the same notify.

> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel DPG Cloud Engineering
>
>
>
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

Received on 2022-07-22 10:41:37