comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Common sense...
Date: 06 Jul 2002 07:51:15 +0100
Date: 2002-07-06T07:51:15+01:00	[thread overview]
Message-ID: <x7v3cuxnycc.fsf@pushface.org> (raw)
In-Reply-To: EykV8.2130$7i3.128975@newsfep1-win.server.ntli.net

"chris.danx" <spamoff.danx@ntlworld.com> writes:

> What's the right thing to do in the following scenario concerning
> iterators and lists?
> 
> A list is in use by three iterators, A, B and C.  A is at the
> position preceding B and C, C calls the remove subroutine on that
> node and moves on.  The nodes iterator count which was 2 is
> decreased to 1.  B is the only iterator using that node, but A wants
> to moves to the next position before B exits the node (if B had
> exited the node prior to A calling next, there'd be no problem).
> Where does A go?  Does it go to the node at B or does it go to the
> one after B?
> 
> I'd say A skips the node but I've got to go, Dinners out, and so
> can't explain my thoughts on why until later!

Although the BCs support some concurrency, I think it's a minefield
and you'd be better off saying DON'T DO THAT!

My (limited) experience of actually _using_ the BCs in a concurrent
situation have convinced me that no general purpose solution is going
to support every usage that your users can dream up, so don't try. I
might (depending on user response) consider deprecating[1] the
concurrency support (at least as built into the BC containers, I think
there's some value in reusable Semaphores, Monitors and Locks maybe).

Consider the comparison with file IO (files are a sort of container,
after all).

[1] Should we lobby for "pragma Deprecate" in Ada0Y ?-)



  parent reply	other threads:[~2002-07-06  6:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-05 17:19 Common sense chris.danx
2002-07-05 17:28 ` Wes Groleau
2002-07-05 17:58   ` chris.danx
2002-07-05 21:34     ` Wes Groleau
2002-07-05 18:31 ` Jeffrey Carter
2002-07-05 18:54   ` chris.danx
2002-07-06  1:26     ` Jeffrey Carter
2002-07-06 10:28       ` chris.danx
2002-07-06 20:07         ` Jeffrey Carter
2002-07-06  6:52   ` Simon Wright
2002-07-05 20:16 ` chris.danx
2002-07-06  6:51 ` Simon Wright [this message]
2002-07-12 18:01   ` chris.danx
replies disabled

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