3 ms·
Sounds like code proofs and other things which I last saw in the 1990s in school. But I see how once you have to cross the rubicon to parallel processing, to m
by AtlasBarfed 4y ago
Sounds like code proofs and other things which I last saw in the 1990s in school.
But I see how once you have to cross the rubicon to parallel processing, to make it sane, you'll need to rethink the old ways from simpler serial execution programming.
- samsquire 4y agoI wrote a lock free algorithm. Every thread monitors every other thread's thread Id and the lowest thread Id wins. When a thread finishes its work it updates the thread Id to Integer.MAX_INTEGER so someone else can have a go. Readers block writers and writer's block readers so it's not very good. But it's a start. It's hard to update a linked list as you could accidentally partially update it while it is being iterated. I could allow parallel edits and reads if the read is after the edit. So I would need to introduce a different variable for checking while reading. It needs to be logically after the write. HTTPS://GitHub.com/samsquire/compare-and-swap-sort