[Solved] Is Application.DoEvents() a form of Multitasking?


I am pretty sure it is a very early, very primitive, Windows Forms only form of Multitasking

You are pretty close to correct on all counts except for your conjecture that it is for WinForms only. “DoEvents” precedes WinForms; it was present in Visual Basic long before WinForms was invented, and “pump the message queue” obviously precedes VB also. And it was a bad idea and easily abused then too.

Making the rest of said Event a continuation to be run later.

DoEvents doesn’t really make anything into a continuation the way that say, await does. Whatever event is currently “in flight” when DoEvents is called has its state on the stack, and the stack is the implementation of continuation in this case. This is another point against DoEvents — unlike await, it eats stack, and therefore can contribute to an overflow.

I just ran into a poster that insists it has “nothing to do with Multitasking”.

You should ask the author for clarification then, since that certainly sounds wrong.

2

solved Is Application.DoEvents() a form of Multitasking?