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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4d2a71c8801ecab1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-06 00:07:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!pogner.demon.co.uk!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Common sense... Date: 06 Jul 2002 07:51:15 +0100 Organization: Pushface Sender: simon@smaug Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk X-NNTP-Posting-Host: pogner.demon.co.uk:62.49.19.209 X-Trace: news.demon.co.uk 1025939184 nnrp-14:18498 NO-IDENT pogner.demon.co.uk:62.49.19.209 X-Complaints-To: abuse@demon.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: archiver1.google.com comp.lang.ada:26896 Date: 2002-07-06T07:51:15+01:00 List-Id: "chris.danx" 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 ?-)