3 ms·
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 e
by nine_k 5y ago
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?
- pjmlp 5y agoGPGPU programming with multiple rendering threads for example.
- tsimionescu 5y agoSerialization 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).
- nine_k 5y agoI 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.