home *** CD-ROM | disk | FTP | other *** search
- Path: sparky.navsea.navy.mil!matuli_a
- From: matuli_a@marlin.navsea.navy.mil (Alex Matulich 03T1 602-6691)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Messages vs. Semaphores for external clocking
- Date: 8 Apr 1996 14:02:42 GMT
- Organization: Naval Sea Systems Command Code 03T1
- Message-ID: <4kb6a2$cal@sparky.navsea.navy.mil>
- References: <4ju349$r1e@sparky.navsea.navy.mil> <4jvrqs$hk0@btmpjg.god.bel.alcatel.be> <slN3BCS00iWZ0_8G1R@andrew.cmu.edu> <316533DF.5BFD@bat710.univ-lyon1.fr>
- NNTP-Posting-Host: marlin.navsea.navy.mil
-
- Laurent GIROUD <milu28@bat710.univ-lyon1.fr> wrote:
- }> > Use global data, which your subtask fills with the timer-values,
- }> > and the parent process reads. Disable() and Enable() multitasking
-
- }> This is very, very bad advice. A message port or a semaphore is indeed
- }> needed. Disable()/Enable() are bad programming styles, especially for
-
- } Of course but you must not forget something -> in order to be sure
- }that the semaphore you are just refering to in your program is valid
- }you actually HAVE to FindName() it before and then to acces it in an
- }atomic operation thus needing to embrace the two instructions (FindName
- }+ ObtainSemaphore) in a Forbid()/Permit() pair...
-
- Now, I didn't know this. I thought FindName() was something I had to do
- only once, and thereafter I could access the semaphore whenever I pleased,
- locking it and unlocking it as needed.
-
- Other people's suggestion to use a double-buffered semaphore sounds
- interesting, and might increase eficciency.
-
- --
- /|
- Alex Matulich __. __=#|| ___ _o--
- matuli_a@marlin.navsea.navy.mil ____##_/_____|==###===###____
- \____________________________\
-