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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Musings on RxAda Date: Wed, 21 Oct 2015 21:35:17 +0200 Organization: cbb software GmbH Message-ID: References: <75f38e30-42ba-4e98-8f36-2218b5167209@googlegroups.com> <1wvo1b25eaa4o$.1y03vu1to6vux$.dlg@40tude.net> <18xpt5oxiz5nw$.klh515586pjp.dlg@40tude.net> <3a82a370-2175-4cf6-90e1-64fb19d794ff@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: j6IQVb9uobzjXrpQLDU2rQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28024 Date: 2015-10-21T21:35:17+02:00 List-Id: On Wed, 21 Oct 2015 12:09:58 -0700 (PDT), Hadrien Grasland wrote: > So you would essentially store a pipeline of data and operations in some > container, then perform all of them on the same thread when the output of > the pipeline is requested ? I don't know your requirements. In a FIFO scenario, yes, the publisher pushes the object. The subscriber pulls it out. In a blackboard scenario (non-blocking) the publisher pushes the object and the subscribers scan the blackboard for updates. Of course in a modern typed language like Ada you would not mess with "data and operations." There are objects for that. The type of the object determines the operations. > This seems much more complex to implement to me, since your operation > queue needs to be able to store data of any type and operation function > pointers, all in a type-safe way. As far as I can tell, you cannot use > streams for that because a stream requires you to know what you are > reading from it. That is because you are trying to think about it in terms of C. Ada is not C, luckily. It is quite straightforward to marshal T'Class objects with a dispatching operation Do_It. And yes, it is as much easy to marshal handles to reference-counted objects if objects are expected large (and you have shared memory). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de