Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: bob Newsgroups: comp.programming Subject: Re: message pumps Date: Thu, 7 Jun 2012 07:53:27 -0700 (PDT) Organization: http://groups.google.com Lines: 22 Message-ID: References: <4de64597-470f-4cb0-8857-e1f6d0734aeb@googlegroups.com> <0.5f2f2578cd88ccc57705.20120607113414BST.87ipf39zrt.fsf@bsb.me.uk> NNTP-Posting-Host: 71.21.226.7 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1339081257 28739 127.0.0.1 (7 Jun 2012 15:00:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 7 Jun 2012 15:00:57 +0000 (UTC) In-Reply-To: <0.5f2f2578cd88ccc57705.20120607113414BST.87ipf39zrt.fsf@bsb.me.uk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.21.226.7; posting-account=v1lx5wkAAAALWYfGBkwkMb2guPF9cW2u User-Agent: G2/1.0 X-Received-Bytes: 2080 Xref: csiph.com comp.programming:1743 On Thursday, June 7, 2012 5:34:14 AM UTC-5, Ben Bacarisse wrote: > bob writes: > > > Why is it that they don't seem to teach message pumps in computer > > science classes? > > What's to teach? The other half of the world calls it an even loop (I > had to look it up), but even so it merits hardly more than a passing > remark. If you mean that students should learn about event-driven > programs, then I can see the point, but there are a very large number of > programming styles, and not all can be covered. > > -- > Ben. I'm guessing you mean "event loop." With event loops, there are many things that can go wrong that I have never seen analyzed: One thing is where the message pump thread performs a long-running operation and doesn't pull the next message off the queue for awhile. The OS often notices and accuses the program of not responding. Another potential issue is where events are generated more quickly than they are being processed.