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-10 10:19:10 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: 10 Apr 2002 10:19:10 -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 1018459150 767 127.0.0.1 (10 Apr 2002 17:19:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 10 Apr 2002 17:19:10 GMT Xref: archiver1.google.com comp.lang.ada:22323 Date: 2002-04-10T17:19:10+00:00 List-Id: "Pat Rogers" wrote in message news:... > "Kevin Cline" wrote in message > news:ba162549.0204080905.24486c34@posting.google.com... > > 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. > > When was this? You say that as if it is the current norm -- and it certainly > was in the 1980's -- but surely not still. The compilers I know about that > target Un*x or Linux map tasks directly to the underlying OS's threads, not > their processes. The old Verdix compiler did that many years ago (i.e., mapped > tasks to sprocs). > > > 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. > > Agreed; an undesirable implementation if the option of mapping tasks to Pthreads > was not available, but that's my point -- that was a given implementation that I > don't believe is not the norm today. It doesn't matter much whether it's the norm. If the language standard doesn't guarantee any useful semantics then programs that use the Ada tasking model for the aforementioned purpose are not portable across compilers.