News for hackers. Stuff that matters.
Re:PumpkinOS, a Re-Implementation of PalmOS by grishka on Sunday April 07, 2024 @10:11PM (#39965628)
> It was also the last OS I've used where an app had a central event loop.

Windows is still like that if you use Win32 APIs directly.

All GUI toolkits ever made are like that, but in most of the modern ones, this queue and loop are usually internal and you can only infer their existence by looking at the stack in a debugger or when something crashes.

Re:PumpkinOS, a Re-Implementation of PalmOS by pjmlp on Monday April 08, 2024 @02:41AM (#39966872)
> Windows is still like that if you use Win32 APIs directly.

Which is basically the only option for C and C++ developers, when using vanilla Visual Studio, unless they want to write libraries to be consumed by .NET instead, or use a third party framework.

It is either raw Win32 or MFC, don't even bother with WinUI.

Re:PumpkinOS, a Re-Implementation of PalmOS by p_l on Monday April 08, 2024 @03:26AM (#39967107)
Windows doesn't actually have a central event loop, which makes it pretty unique.

macOS/iOS/etc have a central event loop in Cocoa - what more only initial thread is allowed to talk with windowserver!

Xlib pretty much enforced single event loop per connection - XCB allowed more.

In comparison, win32 applications can create an event loop ("message pump") per thread, and you can use GUI calls completely independently on them.

Re:PumpkinOS, a Re-Implementation of PalmOS by kjs3 on Monday April 08, 2024 @02:39PM (#39972530)
I recall there was an Ada X11 server (Mitre?) that used tasks instead of a single event loop, although they may have been papering over an event loop underneath.
Re:PumpkinOS, a Re-Implementation of PalmOS by p_l on Tuesday April 09, 2024 @08:30AM (#39978707)
X11 server side is a bit different case - generally you control all message flows there in custom way.

The windows message loop is essentially something you can create per thread, and "GUI" programs have one initialized for them (thus WinMain instead of main in C).

But you need no special work to create more threads with more loops, in fact making every top-level window a separate thread is trivial (doing it for sub-windows like widgets might be slightly more complex though).