Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mailrus!ames!pasteur!ucbvax!CZHETH5A.BITNET!BIOMED06
From: BIOMED06@CZHETH5A.BITNET
Newsgroups: comp.sys.transputer
Subject: Parallel-C and the use of events: HELP ...
Message-ID: <8808111752.AA03149@cu-arpa.cs.cornell.edu>
Date: 11 Aug 88 17:08:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 32

Problems using the Event in 3L Parallel C:
     
We are using a Transputernetwork for some Realtime-Signal-Processing.
To synchronize our software-processes with the surrounding hardware we intend
to use the Event-Request. The transputer-pin Event is connected with a
periodic timersignal (period = 5..800 ms).
     
1. Question:
-----------
Is the following function correct?
     
#include 
     
void synchronize()
{
        char ch;
     
        chan_in_byte(&ch, EventReq);
        chan_in_byte(&ch, EventReq);
}
     
2. Question:
-----------
Has anybody experience using Event in Multithreaded tasks.
We are synchronizing the different threads using the semaphore functions of
Parallel C.
As long as we do not synchronize the hole task with the hardware using event,
all threads proceed. Otherwise several threads do not get their start
semaphores, allthough the sema_signal() function has been called in the
main thread with the right arguments.
The system behaves like some semaphores would get corrupted by the
synchronize() function.