3 ms·
Data races and other race conditions are still present in concurrent systems without parallelism (of the actually executing at the same time sense, like with mu
by Jtsummers 1y ago
Data races and other race conditions are still present in concurrent systems without parallelism (of the actually executing at the same time sense, like with multiple cores). If they weren't, we wouldn't need most uses of mutexes and semaphores on single core processors. As the book gets into, concurrency is about multiple tasks that are arbitrarily interleaved with each other. That interleaving is why you can have data races and other errors even in a single core system.
- Kranar 1y agoData races are not possible on a single core system.
- convolvatron 1y agothey are entirely possible assuming preemptive scheduling
- Kranar 1y agoYes that's true and I was wrong to say otherwise. A data race can happen with preemptive multithreading on data whose size exceeds what the platform guarantees to access atomically, typically the word size. A more accurate statement would be that parallelism introduces additional possibilities for data races than those possible from concurrent execution (without parallelism).
- deleted 1y ago[deleted]