|
|
|
|
|
by molo_
5371 days ago
|
|
This is more than just a quirk. Lets go through the bogons here: 1. Signal system confuses notifications with commands 2. API ties windows to threads 3. System allows you to send WM_DESTROY from one thread to another even though it provides undefined behavior 4. DestroyWindow() can only be called from a particular thread (related to item #2) 5. The API doesn't detect that the window has been destroyed as far as the application is concerned (whatever happens in ForgetWorkerThread() or PostQuitMessage(), the window actually goes away) without a DestroyWindow() call. In short, WTF. [edit: format] |
|
OK, so what's the alternative? Automatic locking at OS-level? How can the performance penalty in those many cases where it is not needed be justified? Same goes for your arguments 3, 4 and 5 btw. Why should such low-level functionality impose important design decisions on those who follow the documentation, just to protect the beginners who don't? I much prefer my raw control, thanks - and I'll happily take the few times I shoot myself in the foot with it, err, with it.
Despite its warts and its legacy cruft, the win32 is quite flexible, and easy to understand - at a very basic level, not much studying of under-the-hood stuff required. For an OS-level API, it packs a lot of power into a small set of concepts.