comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Musings on RxAda
Date: Wed, 21 Oct 2015 15:35:22 +0200
Date: 2015-10-21T15:35:22+02:00	[thread overview]
Message-ID: <1wvo1b25eaa4o$.1y03vu1to6vux$.dlg@40tude.net> (raw)
In-Reply-To: 75f38e30-42ba-4e98-8f36-2218b5167209@googlegroups.com

On Wed, 21 Oct 2015 05:12:40 -0700 (PDT), Hadrien Grasland wrote:

> Reading through my post again, I should 1/Apologize for the missing words
> here and there and 2/Point out that my implementation of Observable is
> mostly synchronous, because all the costly mapping work occurs within the
> accept rendezvous.
> 
> To make an asynchronous Observer would require quite a couple more tweaks,
> allowing the Observer task to save its entry parameters and use them once
> the computation is over. In particular, the output channel should be
> passed by access, rather than by in out value.
> 
> This does not, however, void my core point that Ada's accessibility rules
> would end up getting in our way if we wanted to implement something like
> ReactiveX for Ada.

Not going to pretend understanding what are you talking about, but
synchronous vs. asynchronous in the context of publisher / subscriber is
determined by whether the publisher is blocked by subscriber(s) or not.

From that point of view using tasks or other synchronization mechanism in
the non-blocking (and thus asynchronous, and thus marshaling) scenario is
straight out wrong. See? If you block, it is not asynchronous.

A proper design pattern for non-blocking (and thus non-delivery guaranteed)
1-n publisher / subscriber scenario is a blackboard or sets of queues on
the subscriber's side. Neither require tasks, nor access types (no in the
form that something gets allocated in a conventional memory pool).

Yes, at some point you will need to defeat the type system. That is a job
for stream attributes, "for address use", or a fake memory pool. Either
would work.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2015-10-21 13:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 14:30 Musings on RxAda Alejandro R.  Mosteo
2015-10-15 14:40 ` brbarkstrom
2015-10-21 11:45 ` Hadrien Grasland
2015-10-21 12:12 ` Hadrien Grasland
2015-10-21 13:35   ` Dmitry A. Kazakov [this message]
2015-10-21 16:18     ` Hadrien Grasland
2015-10-21 16:47       ` Dmitry A. Kazakov
2015-10-21 19:09         ` Hadrien Grasland
2015-10-21 19:35           ` Dmitry A. Kazakov
2015-10-21 21:04             ` Hadrien Grasland
2015-10-22 11:02               ` Alejandro R.  Mosteo
2015-10-22 12:33                 ` Dmitry A. Kazakov
2015-10-22 16:41                   ` Alejandro R.  Mosteo
2015-11-19 13:14 ` Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox