repeat something in a thread, but stop when the program stops
jeff at ccvcorp.com
Wed Sep 29 20:07:39 CEST 2004
Harald Massa wrote:
>My impression from reading dispatcher-code was more in the area of:
>with "get_message_from_windows()" silently and cycle-free blocking until
>windows decides to distribute a message. Something like a blocking
>socket, which makes a program wait.
Essentially true, but Windows sends a lot more messages than most people
realize, even to "dormant" apps sitting in the system tray. Even if you
code your own windowproc and handle a bunch of messages yourself, the
vast majority of Windows messages get passed on to DefWindowProc()
(provided by Windows).
Of course, the point is that in practice, it hardly matters. On any
reasonably recent PC, handling a few hundred messages every second is
trivial. (As long as the message handlers don't access "slow"
resources, at least...)
More information about the Python-list