LogFAQs > #929564788

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, Database 5 ( 01.01.2019-12.31.2019 ), DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
Topicfuck race conditions.
Lokarin
11/02/19 12:39:29 PM
#12:


Sahuagin posted...
Lokarin posted...
I don't understand the usage of race in this context.

if you use multi-threading, or other scenarios where the same code can be executed more than once simultaneously by two difference threads/processes, the actual order in which the instructions execute is unknown (each execution context will occur in its own order, but they will all be interleaved together in some random way). in particular this means that you can't rely on a read of a variable staying true until the next instruction (at least if there are also writes to that variable, which is one reason why immutability (readonly variables) is desirable). race condition specifically is saying "whoever gets there first wins", and the problem is you never know who will get there first.


Interesting, but it seems like outcome dependent events should be single-threaded for that exact reason... even if it creates a small bottleneck for the multithreading events before it
---
"Salt cures Everything!"
My YouTube: https://www.youtube.com/user/Nirakolov/videos
... Copied to Clipboard!
Topic List
Page List: 1