From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c2dda499a002ec3c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-08 10:05:28 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: kcline17@hotmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: rendez-vous underlying mechanism Date: 8 Apr 2002 10:05:27 -0700 Organization: http://groups.google.com/ Message-ID: References: <3CA2A827.11140295@adaworks.com> NNTP-Posting-Host: 192.76.70.225 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1018285528 5295 127.0.0.1 (8 Apr 2002 17:05:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 8 Apr 2002 17:05:28 GMT Xref: archiver1.google.com comp.lang.ada:22231 Date: 2002-04-08T17:05:28+00:00 List-Id: Richard Riehle wrote in message news:<3CA2A827.11140295@adaworks.com>... > Kevin Cline wrote: > > > "Bozo" wrote in message news:... > > > Hi all, > > > > > > I'm sorry I wasn't clear enough. > > > I don't use ADA at the moment but I was a brave ADA programmer once. > > > I use C at the moment and I have a case where synchronous rendez-vous would > > > be better that traditional asynchrounous intertask communications. > > > > > > Does anyone have an idea how to implement that in C with semaphores for > > > example ? > > > > This depends on the underlying OS. If you are using pthreads, > > then see the manual entry for pthread_cond_wait. > > This approach, of course, does not come close to the capabilities > already built-in to the Ada tasking model. Ever heard of protected > types. I know that. However, in a hosted environment, the imperfect mapping between the Ada tasking model and the underlying OS facilities can catch programmers by surprise. I was certainly surprised when I attempted to create a separate task for I/O but found that all tasks blocked anyway because they were mapped to a single Unix thread. On that implementation Ada multi-tasking was uselsss for solving problems routinely handled with Posix threads.