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