comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Lightweight tasks to implement co-routines?
Date: Tue, 1 Aug 2017 08:47:52 +0200
Date: 2017-08-01T08:47:52+02:00	[thread overview]
Message-ID: <olp86q$1ssv$1@gioia.aioe.org> (raw)
In-Reply-To: olp1lm$ui8$1@franka.jacob-sparre.dk

On 2017-08-01 06:56, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> news:olo5rp$dp0$1@gioia.aioe.org...
>> On 2017-07-31 20:08, Victor Porton wrote:
> ...
>> I have a vague idea that it should be an entry of some ad-hoc fake
>> protected object that would glue both calls together, or maybe an entry of
>> the "carrier" task. But I don't know how to make this easy to use and
>> encapsulated without exposing to other contexts.
> 
> Tucker Taft is proposing a construct called a "channel" for this purpose. It
> sounds interesting, but there are so few details it is impossible to tell.
> There is an AI for it (AI12-0197-4), but it is empty pending a real proposal
> from Tucker.

Yes, at least the use case is same.

One very important thing though. The construct cannot be statically 
nested as suggested. Consider the case when one producer distributes 
items among several consumers. As a practical example take a multiple 
socket select in the producer that then yields to one of the consumers 
to handle the active socket or else to process socket I/O data.

1. You don't know in advance how many consumers (connections) there will be.

2. There are multiple groups of identical consumers.

I am sure there could be cases with multiple producers as well.

This is why I thought that a task would be a much better way to express 
co-routine than some nested block.

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


  reply	other threads:[~2017-08-01  6:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 18:08 Lightweight tasks to implement co-routines? Victor Porton
2017-07-31 20:00 ` Simon Wright
2017-07-31 21:01 ` Dmitry A. Kazakov
2017-08-01  4:56   ` Randy Brukardt
2017-08-01  6:47     ` Dmitry A. Kazakov [this message]
2017-08-01  4:53 ` Randy Brukardt
2017-08-01  6:49 ` Paul Rubin
replies disabled

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