Date: Thu, 4 Dec 2025 05:18:03 +0000
On Dec 3, 2025, at 22:08, Nate Eldredge via Std-Discussion <std-discussion_at_[hidden]> wrote:
>
> So consider threads doing the following:
>
> std::atomic<int> snarks_found;
>
> void bellman() {
> snark s;
> do {
> s = hunt();
> snarks_found.store_add(1);
> } while (!s.is_boojum());
> }
>
> assuming that hunt() and is_boojum() are pure functions that return in finite time
I shouldn't have said "pure" because then they'd return the same value every time. What I mean is that they don't have any externally visible effects. They might read and write some non-atomic, non-shared internal state, as well as `s` itself.
>
> So consider threads doing the following:
>
> std::atomic<int> snarks_found;
>
> void bellman() {
> snark s;
> do {
> s = hunt();
> snarks_found.store_add(1);
> } while (!s.is_boojum());
> }
>
> assuming that hunt() and is_boojum() are pure functions that return in finite time
I shouldn't have said "pure" because then they'd return the same value every time. What I mean is that they don't have any externally visible effects. They might read and write some non-atomic, non-shared internal state, as well as `s` itself.
Received on 2025-12-04 05:18:05
