5 ms·
A big reason why multithreaded UI doesn't work is that the platform code (win32, cocoa) generally has poor support for interacting with OS objects from multiple
by wrl 11y ago
A big reason why multithreaded UI doesn't work is that the platform code (win32, cocoa) generally has poor support for interacting with OS objects from multiple threads. For instance, NSView instances can only be operated on from the main thread (https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html https://developer.apple.com/library/mac/documentation/Cocoa/...).
Handling OpenGL context access from multiple threads is terrible, too. I'm quite excited about the additional threading niceties that we're getting in Vulkan, which should allow separate threads to re-render parts of the UI and then send the command buffers back to the main thread.
- mpweiher 11y ago> For instance, NSView instances can only be operated on from the main thread Cocoa is the toolkit, not the OS, so this is just Cocoa taking exactly the approach described in the fine article.
- wrl 11y agoIt's also an unavoidable part of writing graphical code on OS X, so, for all intents and purposes, it is the OS.