home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!uwm.edu!biosci!oracle!unrepliable!bounce
- From: dnavas@oracle.uucp (David Navas)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: RKM description of WaitPort()
- Message-ID: <1993Jan7.230844.17921@oracle.us.oracle.com>
- Date: 7 Jan 93 23:08:44 GMT
- References: <38385@cbmvax.commodore.com> <1993Jan7.201052.13703@samba.oit.unc.edu>
- Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
- Organization: Oracle Corporation, Redwood Shores CA
- Lines: 30
- Nntp-Posting-Host: mailseq.us.oracle.com
- X-Disclaimer: This message was written by an unauthenticated user
- at Oracle Corporation. The opinions expressed are those
- of the user and not necessarily those of Oracle.
-
- In article <1993Jan7.201052.13703@samba.oit.unc.edu> Todd_Lewis@unc.edu (Todd M. Lewis) writes:
- >I've used this dozens of times, but the other day I was getting
- >messages from port 1 faster than I could process them so that
- >I never got around to processing port 2's message, an act which
- >would have made port 1's messages stop comming. A busy dead-lock.
- >Now I do something like this:
-
- Yep, the "simple" way to deal with message processing can cause problems --
- particularly if you've done something weird like take apart loops in your
- code and send a message to yourself to compute the next part of your loop
- (useful for handling things like ARexx-quit, ^C, window-close, etc. messages).
-
- Todd's code works perfectly well, another way to do it is to grab all of
- the messages off of one port into a local list, and all of messages off the
- second port into a separate local list, and then pull the messages back off
- the local lists.
-
- Whichever floats your boat, so-to-speak.
-
- I prefer the latter because I can think of things as taking a "snapshot"
- of the current port contents and then dealing with those contents -- but that's
- just because I had to write a library that had to take into account some
- very bizarre programmer/user itneraction :) The only advantage I really
- see is a pseudo-chronological coherency, which is most often not terribly
- useful.
-
- Comments?
-
- David C. Navas dnavas@oracle.com
- Working for, but not speaking on behalf of, Oracle Corp.
-