home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18317 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.1 KB

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