C++ Logo

std-discussion

Advanced search

Re: Fwd: Synchronization of atomic notify and wait

From: Thiago Macieira <thiago_at_[hidden]>
Date: Wed, 20 Jul 2022 16:21:05 -0700
On Wednesday, 20 July 2022 16:10:25 PDT Marcin Jaczewski wrote:
> https://timsong-cpp.github.io/cppwp/n4861/intro.multithread#intro.progress-1
> 8
> https://timsong-cpp.github.io/cppwp/n4861/atomics.order#11

"Reasonable time" and "finite time" do not convey any specificity into how long
that is. A century is a finite time and may be reasonable for some system.

> This both limits this will not be a century. but some short time could
> still be possible.

It actually limits to anything short of "forever", but "a century" is allowed.

The system must somehow detect if it is not making any forward progress.
Something sitting in a cache without ever being flushed is a recipe for
deadlock and violates the requirement that it is done in a finite amount of
time.

So for a system that has such loose caching structures, an atomic operation
would need to include the cache flushing instructions to ensure it will
eventually happen.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2022-07-20 23:21:06