home *** CD-ROM | disk | FTP | other *** search
- Path: enea.se!not-for-mail
- From: olli@enea.se (Ola Liljedahl)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Messages vs. Semaphores for external clocking
- Date: 11 Apr 1996 01:57:51 +0200
- Organization: Enea OSE Systems AB; "OSE - Design on a higher level"
- Message-ID: <4khhtv$52e@gordon.enea.se>
- References: <4ju349$r1e@sparky.navsea.navy.mil> <4jvrqs$hk0@btmpjg.god.bel.alcatel.be> <heinz.17rm@hwg.muc.de> <4kfmes$lle@btmpjg.god.bel.alcatel.be>
- NNTP-Posting-Host: gordon.enea.se
- Keywords: interprocess communication, synchronization, real time system
-
- Jaco Barnhoorn wrote:
- > In article <heinz.17rm@hwg.muc.de>, heinz@hwg.muc.de (Heinz Wrobel) writes:
- > >barnhoorn@nlev00 wrote:
- > >>Use global data, which your subtask fills with the timer-values,
- > >>and the parent process reads. Disable() and Enable() multitasking
- ^^^^^^^^^^^^^^^^^^^^^^
- disables and enables interrupts!!!
- > >>when performing such a critical action (reading or writing from the
- > >>global data). No message port or semaphore needed.
- > >
- > >Obviously this is the dumb c0d3r non multitasking solution, i.e.
- > >plain stupid.
- > >
- > ..not so obviously. When you have two tasks, and one of them is
- > collecting data from some source, and the other one needs this data
- > with regular intervals, I don't see a more easier way to do this
- ^^^^^^
- this is a lame excuse
- > then by using global data and disable/enable multitasking. It is
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Forbid() and Permit()
- > a very multitasking-friendly solution, and there is nothing
- > 'dumb c0d3r' (whatever that may be) about it.
- >
- > --
- > ---------------------------------------------------------------------------
- > Jaco Barnhoorn barnie@xs4all.nl
- > Software Test Engineer barnhoorn%nlev00@btmv56.se.bel.alcatel.be
- > Alcatel Telecom Systems
- ^^^^^^^^^^^^^^^
- Telecom IS real time!!! (or used to be)
- > Rijswijk, The Netherlands
-
- I am new to this thread, but your talk about disabling interrupts because
- you are referencing a global data area makes me feel sick. Have your ever
- heard of real time systems??? You DON'T disable interrupts for an
- (indeterminate) time! You don't know anything about what else goes on in
- the system and might need the short deterministic interrupt latency.
- Disabling the dispatcher (Forbid()) isn't that dangerous but still not
- recommended, it will prevent the OS from scheduling processes that
- nominally have higher priority.
-
- If you are programming an embedded system where you have total control
- over all software and know all components timing needs you may disable/
- enable interrupts and/or multitasking. It is up to you to guarantee that
- the system works according to specifications.
-
- But in a system like the Amiga where the user may run several different
- applications at the same time you should not tamper with the system's
- scheduling. Use a global data area protected by a semaphore/mutex or
- send messages if you want more asynchronous behaviour.
-
- Check out http://www.enea.se/ose for information about OSE, the real time
- operating system from Enea OSE Systems.
-
- Regards,
-
- Ola Liljedahl
- olli@enea.se
- "OSE - Design on a higher level"
-