News for hackers. Stuff that matters.
Re:The memory models that underlie programming languages (2016) by nine_k on Thursday June 10, 2021 @03:36AM (#27457969)
I don't immediately see why something like a window manager might need a data structure which requires multiple concurrent writers. Or, while at it, why can't events coming to each window be perfectly serialized and not require any concurrent mutation. Could you share an example?
Re:The memory models that underlie programming languages (2016) by tsimionescu on Thursday June 10, 2021 @06:07AM (#27458951)
Serialization does not eliminate concurrency, it is a strategy for dealing with it. That is, when your abstract model requires concurrent writes, you can instead add the operations to an event queue and process them serially. The event queue itself is still concurrently written to. You also still face complex problems with dependent writes - e.g. when two writers want to increment the same place (even worse when they need to apply a more complex function than incrementing, and worse of all when they want to apply a non-pure function to the current value).
Re:The memory models that underlie programming languages (2016) by nine_k on Thursday June 10, 2021 @02:16PM (#27463683)
I agree, but I still can't see where a WM might need to concurrently write to a per-window event queue. Also, I can't see why pushing onto a queue can't be blocking (with a timeout) and use a mutex, if multiple threads need to write to it.

With game engines, all bets are off, of course.

Re:The memory models that underlie programming languages (2016) by pjmlp on Thursday June 10, 2021 @05:16AM (#27458620)
GPGPU programming with multiple rendering threads for example.