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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!blackbush.cw.net!cw.net!feed.news.tiscali.de!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Rendezvous based mutithreading. Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> <4241e04c$0$11471$9b4e6d93@newsread2.arcor-online.net> <1111614619.83944@athnrd02> <3895971.bl8ACDBTNI@linux1.krischik.com> <1111721265.519102@athnrd02> <1776861.Inq2IMonX4@linux1.krischik.com> Date: Fri, 25 Mar 2005 17:41:36 +0100 Message-ID: <1v77bmpharzqc.xdxzsi8p3kwi$.dlg@40tude.net> NNTP-Posting-Date: 25 Mar 2005 17:41:30 MET NNTP-Posting-Host: 797d7303.newsread4.arcor-online.net X-Trace: DXC=jYo<5JVBFR\MYeRE0Pb_HU:ejgIfPPldTjW\KbG]kaMXFYk:AnJB[C]on\\O]B`]E^[6LHn;2LCV^COgUkn_?_Y_9WM4<_?N6CW X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9988 comp.lang.c++:47249 comp.realtime:1720 Date: 2005-03-25T17:41:30+01:00 List-Id: On Fri, 25 Mar 2005 13:42:31 +0100, Martin Krischik wrote: > But I think it would be quite a challenge to create rendezvous based > multithreading on top of C++ templates - and yet keep it easy to use for > the programmer. We did it in our proprietary C++ library, and without any templates, BTW. The pattern is: 1. A rendezvous queue type either to derive task objects from or to mix-in. A task periodically polls the queue, it can also wait for a queuing event. 2. An abstract rendezvous object type to queue. User-defined rendezvous objects were derived from there. When rendezvous happened a virtual method was called. We supported timed calls, and even a kind of re-queuing to mimic this extremely useful feature of Ada 95. Of course it is not as easy to use it as Ada's rendezvous, but it is usable and works fine. The advantages rendezvous have over queues are that as in Ada there is no need to marshal parameters here and there, no need in any locks, no problem to have results. The most difficult problem is exception handling. In Ada, rendezvous exceptions are propagated in both caller and callee. This is impossible to mimic in C++, because there seems no way to throw same-as-this exception in C++. So we had to fuse all exceptions on the caller's side ... -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de