4 ms·
One of the things the article doesn't mention, which is odd, is that frames are precious objects that need to be produced in whole. If you have multiple threads
by kllrnohj 11y ago
One of the things the article doesn't mention, which is odd, is that frames are precious objects that need to be produced in whole. If you have multiple threads all producing parts of the scene, when do you actually kick off the frame so that the user never sees a part of a frame? Even if your worker thread is just updating the text of a few fields when it's done, you need to batch that up into a single atomic update on the screen.
Which means you need transactions, at which point you basically have a single thread and a message queue so why complicate things internally and add all the lock/unlock overhead?
- kragen 11y agoMost GUI toolkits don't bother. I'm guessing you work in video games?
- kllrnohj 11y agoEvery GUI toolkit already "bothers" by virtue of being single threaded. You never see a UI toolkit where this: btn.setText("hello") btn.setColor(BLACK) might show a white-text "hello" for a single frame. If the UI toolkit was thread-safe, though, that would become a possibility.