home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6930 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.NetVision.net.il!news
  2. From: Jack <avilev@netvision.net.il>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Messages vs. Semaphores for external clocking
  5. Date: Fri, 05 Apr 1996 08:52:54 -0800
  6. Organization: NetVision LTD.
  7. Message-ID: <31654FE6.5E2B@netvision.net.il>
  8. References: <4ju349$r1e@sparky.navsea.navy.mil>
  9. NNTP-Posting-Host: ts007p7.pop4a.netvision.net.il
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (Win16; I)
  14.  
  15. Alex Matulich 03T1 602-6691 wrote:
  16. > I am wondering what is the most efficient way for one task to make data
  17. > available to another task.  I can do this by passing messages, or by
  18. > setting up a semaphore to provide a common area of memory accessible by
  19. > both tasks.
  20. > you'll always have some amount of overhead if you use system functions. but,
  21. if you need real-time response from the system then, all you have to do is
  22. raise the monitor tasks' priority to higher level. use double-buffering here,
  23. one buffer for the monitor task to fill and the other buffer for the application to
  24. use. use semaphores of course to maintain sync between the tasks. that way you'll alwasy
  25. keep an eye on your device's input and the application would get the data only when it's
  26. ready in one of the buffers. use the buffer alternativly, first one then the other.
  27. be careful when calculating the buffer sizes otherwise your application
  28. might not process the data in 'real-time'.
  29.  
  30. Avi Lev.
  31.