Promise<void> is a funny type.

"Do you promise?"
-"Yes I promise."
"What do you promise?"
-"Nothing!"
31
32
435
Replying to @olafurw
@olafurw Still, I want regular void more than I worry about any weird stories we’ll be able to tell with regular void. Not unlike this one.
1
0
3
Replying to @__simt__
@olafurw I am ready and willing to standardize std::atomic<void> here!
2
0
7
Replying to @__simt__
@__simt__ @olafurw std::atomic<void> is semantically the same as a barrier?
1
0
1
Replying to @jfbastien
@jfbastien @olafurw Gods, no!

I think you could dead-code-eliminate all of it, in fact.

I do have one question: does this assert, or not?
void v = av.load();
assert(av.compare_exchange_strong(v, void()));

This is why we need regular void to appear first.
1
0
1
Replying to @__simt__
@__simt__ @olafurw I think some std::atomic<void> operations would at a minimum be a 𝑟𝑒𝑙𝑒𝑎𝑠𝑒 𝑠𝑒𝑞𝑢𝑒𝑛𝑐𝑒. 😇

And don't forget about 𝚟𝚘𝚕𝚊𝚝𝚒𝚕𝚎 𝚜𝚝𝚍::𝚊𝚝𝚘𝚖𝚒𝚌<𝚟𝚘𝚒𝚍>
1
0
2
Replying to @jfbastien
@jfbastien @olafurw You can create an unobservable release sequence.

Sure, you can have a volatile atomic<void>! Why not.
1
0
0
Replying to @__simt__
@__simt__ @olafurw My question is then about identity: whether std::atomic<void> are all the same void, or if there are multiple voids 🤔
1
0
5
Replying to @jfbastien
@jfbastien @olafurw That's the clarity I seek from regular void.

Particularly, whether the memcmp() of two regular voids needs to return equal or not.
2
0
0
Replying to @__simt__
@__simt__ @olafurw I'm going further than memcmp! Identity would mean that all std::atomic<void> are the "same" atomic in that you can establish a global total order by reading and writing to separate std::atomic<void>.

I think doing this would be counter to regular void.
1
0
1
Replying to @jfbastien
@jfbastien @olafurw When you read a void out of this atomic, you will never be able to know which is the prior write you’ve observed in the total order. So anything is still possible.
1
0
2
Replying to @__simt__
@__simt__ @jfbastien @olafurw Think of regular void as

struct Void {};

(With default ==, etc)

Do whatever it does.
2
0
5
Replying to @tvaneerd
@tvaneerd @__simt__ @olafurw Booooorrrrriiinnngggg.
1
0
5
Replying to @jfbastien
@jfbastien @tvaneerd @__simt__ @olafurw I love boring language constructs that fall out of a clean design. We just hit on a couple of those in Carbon and it was really satisfying.
1
0
5
Replying to @chandlerc1024
@chandlerc1024 @tvaneerd @__simt__ @olafurw Oh I don’t disagree on boring being nice in language design! But this is Twitter 😇
1
0
3
Replying to @jfbastien

Nov 1, 2022 · 7:40 AM UTC

0
0
0
RepliesRelevant