Re:Building a new Windows 3.1 app in 2019: A Slack Client
by loa_in_ on Thursday December 19, 2019 @05:29AM
(#21833602)
Did you get to work with a co-operative task scheduling? This version of Windows still used one I think. What's your experience if so?
[ Parent
| on HN ]
Re:Building a new Windows 3.1 app in 2019: A Slack Client
by cesarb on Thursday December 19, 2019 @05:41AM
(#21833682)
Windows (not only the 16-bit 3.x, but going as far as the newest 64-bit ones) uses an event loop for the GUI: your program runs a loop calling the GetMessage function, which blocks until the next window message is available. As long as you don't take too much time processing each window message, you don't have to even think about cooperative task scheduling, since Windows will do it for you while waiting on GetMessage.
(In fact, AFAIK even in modern Windows you should avoid taking too much time to process each window message, since blocking the event loop thread makes the UI for your program unresponsive.)
Re:Building a new Windows 3.1 app in 2019: A Slack Client
by loa_in_ on Friday December 20, 2019 @01:36PM
(#21846389)
I remember the user experience, I was wondering about design decisions during development.
You are guaranteed no context switches unless you explicitly request one - did it simplify some parts, or alternatively made it more complex? It's an asynchronous application.
Re:Building a new Windows 3.1 app in 2019: A Slack Client
by gmueckl on Thursday December 19, 2019 @06:04AM
(#21833804)
Windows NT and Windies 95 were the first versions to have preemptive scheduling. Windows 3.11 and older would only switch tasks when he program requested new messages from the queue. Thus was totally annoying because most applications were written badly and had moments where they would go off and do things and not return to their message loop for several seconds or worse, hanging the entire system during that time. Windows felt very sluggish because of that.