Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ncis.llnl.gov!lll-winken!lll-lcc!ames!killer!texbell!uhnix1!sugar!peter From: peter@sugar.uu.net (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: Ultimate Wait-GetMsg strategy (?) Message-ID: <3415@sugar.uu.net> Date: 10 Feb 89 13:03:30 GMT References: <890204105857.21000bb9@elcc.epfl.ch> <494@infohh.rmi.de> Organization: Sugar Land Unix - Houston, TX Lines: 24 In article <494@infohh.rmi.de>, shimoda@infohh.rmi.de (Markus Schmidt) writes: > Every time using a Wait-GetMsg-pair I thought how to do it > best way. Now I think I got it: > while (1) { > while (!(imsg= GetMsg(win->UserPort))) > Wait (1<UserPort->mp_SigBit); > ... select imsg->Class and break when ended ... > > } That's really weird. Why don't you just do this: while(1) { Wait(1<UserPort->mp_SigBit); while(imsg= GetMsg(win->UserPort) { ... select imsg->Class and break when ended ... } } Which generalises to multiple message ports a lot better. -- Peter "Have you hugged your wolf today" da Silva `-_-' Hackercorp. ...texbell!sugar!peter, or peter@sugar.uu.net 'U`