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!news4.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!feeder.xsnews.nl!feeder.news-service.com!post.news-service.com!news1.surfino.com!not-for-mail Message-Id: <2919578.tRXogVExfE@linux1.krischik.com> From: Martin Krischik Subject: Re: Rendezvous based mutithreading. Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime Reply-To: martin@krischik.com Date: Fri, 25 Mar 2005 19:21:18 +0100 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> <1v77bmpharzqc.xdxzsi8p3kwi$.dlg@40tude.net> Organization: None User-Agent: KNode/0.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@surfino.com NNTP-Posting-Host: 83.169.175.19 (83.169.175.19) NNTP-Posting-Date: Fri, 25 Mar 2005 21:00:27 +0100 X-Trace: 0b8f642446ddbf60c0ab615078 Xref: g2news1.google.com comp.lang.ada:9994 comp.lang.c++:47279 comp.realtime:1722 Date: 2005-03-25T19:21:18+01:00 List-Id: Dmitry A. Kazakov wrote: > 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 ... Cool. Sad that it is not open source. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com