From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.75.82 with SMTP id a18mr1264041wiw.0.1365341311998; Sun, 07 Apr 2013 06:28:31 -0700 (PDT) MIME-Version: 1.0 Path: p18ni42842wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news.n-ix.net!news.bawue.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Messaging question [was: Is this expected behavior or not] Date: Mon, 1 Apr 2013 18:43:08 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1jtvzi1v65aqm.1k5ejsveno59f.dlg@40tude.net> <1hvv2kd9smnfx.6spgz9thd1mh$.dlg@40tude.net> <1raubw1sk48ca$.69rdgczvnnf.dlg@40tude.net> <2qwq2cdeuvhu$.qtnb8zyhuob9$.dlg@40tude.net> <1u72u7h5j4jg3$.wlxmaltyzqik.dlg@40tude.net> <09f2e5f7-84fe-419b-b27d-207e697c8e46@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1364859793 10901 69.95.181.76 (1 Apr 2013 23:43:13 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 1 Apr 2013 23:43:13 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2013-04-01T18:43:08-05:00 List-Id: "Shark8" wrote in message news:09f2e5f7-84fe-419b-b27d-207e697c8e46@googlegroups.com... > On Friday, March 29, 2013 6:49:25 PM UTC-6, Randy Brukardt wrote: >> >> >> Claw uses hidden operations on window objects to keep the mechanisms of >> the >> message loop hidden away. > > Very tangentially on this; what do you see would be the consequence of a > system > using a loop over a select [for messaging] -- or would it be any > different? > > I'm really fuzzy on my low-level windows programming and, after reading > this >( >http://forums.codeguru.com/showthread.php?449338-Windows-message-loop-efficiency ) >, >I found myself wondering; since you wrote CLAW I thought I'd ask. The reason we hid the loop had to do with correctness more than efficiency. When you explicitly allow fooling with all of that loop mechanism, it's impossible to build anything on top of it and have any hope that it works right, because you're relying on the client to use the object exactly the right way, or it won't work (nor will it give any indication of what you did wrong). In any case, there is *always* a loop inside the application; the question in the thread mentioned above is how the loop is written. You get dozens of messages for typical actions in an Windows program; you need a loop to process them all. I believe we did our waiting at the Ada level, rather than the Windows level, because that prevented locking up the Windows program/thread while waiting for something to happen. We use Ada delays to release the CPU if we don't have anything to do (that way, the Ada runtime knows about the blocking and can schedule other work if appropriate). Again, performance had nothing to do with it, we didn't want to assume a particular Ada runtime model (that is, how tasks are mapped to threads). We tuned the performance after making these choices. Randy.