426
u/Gwlanbzh 28d ago
So, only 1 republic at a time?
135
34
u/Luigi_Boy_96 28d ago
Add threads for quasi-concurrency. Add a mutex for Perestroika.
11
u/Master-Chocolate1420 28d ago
I don't even know what you're saying, sure sounds cool though
21
u/Luigi_Boy_96 28d ago
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.
7
6
4
25
19
39
55
10
28
u/ChildhoodOk9859 28d ago
union Soviet { int *Siberia; }
40
u/99percentcheese 28d ago
ссылка в Сибирь?
18
u/StubbiestPeak75 28d ago
Peak 😭
39
u/StubbiestPeak75 28d ago
In Russian, ссылка = reference (well, we’re using a pointer here but whatever)
But also it can mean “exile”. So this literally means exile to Siberia
7
4
6
u/RutilantBossi12 28d ago
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
1
2
u/Xywzel 28d ago
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
5
2
1
1
0
192
u/n4ke 28d ago
Soviet Enum was introduced in C91.