LogFAQs > #929549457

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.
Sahuagin
11/02/19 12:15:45 AM
#10:


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.
---
... Copied to Clipboard!
Topic List
Page List: 1