3 ms·
the author says that with AWT it was a design decision against thread save GUI, one problem here - there is no way they could have made AWT thread save - AWT us
by MichaelMoser123 11y ago
the author says that with AWT it was a design decision against thread save GUI, one problem here - there is no way they could have made AWT thread save - AWT uses the native windowing toolkit as its basis; on Windows this implies that all clients of the Win32 sdk are from the same thread as the event loop; there is no other means to work with USER32.dll - you have to send windows messages to the window handle, that's only possible from the thread of the event loop
- MichaelMoser123 11y agoit would have been possible without locks if the client would have sent IPC messages to the other threads event queue and then wait until the result comes back. This way all access to the GUI widgets is serialized via the event loop. In windows they had apartment model COM objects that used to work by this principle (ouch, i feel so old now ...)