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 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-10 00:50:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!out.nntp.be!propagator-SanJose!in.nntp.be!dax.net!juliett.dax.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: rendez-vous underlying mechanism References: <3CA2A827.11140295@adaworks.com> From: Ole-Hjalmar Kristensen Message-ID: <7vr8longc3.fsf@vlinux.voxelvision.no> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 10 Apr 2002 07:49:33 GMT NNTP-Posting-Host: 193.216.12.150 X-Complaints-To: abuse@tele2.no X-Trace: juliett.dax.net 1018424973 193.216.12.150 (Wed, 10 Apr 2002 09:49:33 MET DST) NNTP-Posting-Date: Wed, 10 Apr 2002 09:49:33 MET DST Organization: Tele2 Norway AS Public Access Xref: archiver1.google.com comp.lang.ada:22302 Date: 2002-04-10T07:49:33+00:00 List-Id: kcline17@hotmail.com (Kevin Cline) writes: > 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. Yes. The really bad thing about this is that your program will compile and run, but not work as you had expected when you port it to a new platform where Ada tasks has been impelented differently.