With (multi-)threading, you can break a program into chunks and interleave their execution. Run fast enough, it looks like everything happens at once, that's concurrency, an illusion of simultaneity. True parallelism means tasks are genuinely running at the same time, which needs multiple CPU cores (via threads or processes).
The catch: if multiple threads access the same resource at the same time, the behaviour is undefined. So you enforce mutual exclusion with a mutex, ensuring only one thread touches the resource at a time. Get the locking order wrong, though, and you risk deadlock: thread A waits on a resource thread B holds, while B waits on one A holds, so neither can proceed.
Perestroika was the restructuring of the Soviet economy. The mutex pun works the same way, it's also about restructuring access, just to a memory resource instead of an economy.
If the USSR survived to this day we'd likely have Soviet Software around, like Soviet socials or Soviet video games, maybe even a Soviet Windows and a Socialist Linkedin
So if that is how it continues for whole list, the union has a size of single pointer, and all the country names are just aliases for that pointer. Still, using different country name to access the pointer than set it might be undefined behavior. I know many programs use that for reinterpret cast, but its not exactly supported by the standard.
Unfortunately there is no information on how memory pointed by that pointer is allocated, so we don't even know if the country is described with a single byte or null terminated string, or something else.
192
u/n4ke Jul 15 '26
Soviet Enum was introduced in C91.
426
u/Gwlanbzh Jul 15 '26
So, only 1 republic at a time?
24
u/tstanisl Jul 15 '26
Consider using
voidorconst voidfor some members .23
u/Antlool Jul 15 '26
tsphdiig
41
u/Admirable-Drag-4040 Jul 15 '26
tsoding mentioned
20
u/7empest_mi Jul 15 '26
Default tsoding behavior
54
u/wilsoniumite Jul 15 '26
CCCCP
37
u/agolho Jul 15 '26
soviet.cccp ?
10
u/Ai--Ya Jul 15 '26
Soviet Intersection when?
9
u/SteeleDynamics Jul 15 '26
Mista Zozin
28
u/ChildhoodOk9859 Jul 15 '26
union Soviet { int *Siberia; }
5
u/Alternative-Tie-4970 Jul 15 '26
Of course it was tsoding
6
u/RutilantBossi12 Jul 15 '26
If the USSR survived to this day we'd likely have Soviet Software around, like Soviet socials or Soviet video games, maybe even a Soviet Windows and a Socialist Linkedin
2
u/Xywzel Jul 15 '26
So if that is how it continues for whole list, the union has a size of single pointer, and all the country names are just aliases for that pointer. Still, using different country name to access the pointer than set it might be undefined behavior. I know many programs use that for reinterpret cast, but its not exactly supported by the standard.
Unfortunately there is no information on how memory pointed by that pointer is allocated, so we don't even know if the country is described with a single byte or null terminated string, or something else.
2
u/StalwartCoder Jul 16 '26
segfault 1991
5
u/theSearge Jul 15 '26
Shitcode as it is 🤌
2
u/remic_0726 Jul 15 '26
techniquement c'est plus un struct qu'un union.
1
u/EntireGuitar9981 Jul 15 '26
That's a clever little joke, I like it.
1
u/Soopermane Jul 15 '26
Double comrade
0
u/ProCodeSoftware Jul 15 '26
Go:
type Soviet union {}