comp.lang.ada
 help / color / mirror / Atom feed
From: Darren New <dnew@san.rr.com>
Subject: Re: List container strawman 1.3
Date: Thu, 06 Dec 2001 17:47:20 GMT
Date: 2001-12-06T17:47:20+00:00	[thread overview]
Message-ID: <3C0FAF0C.A46BB265@san.rr.com> (raw)
In-Reply-To: DpxP7.50285$xS6.83694@www.newsranger.com

Ted Dennison wrote:
> The list itself will have to
> keep a mini-list of iterators to support invalidating iterators whoose
> pointed-to item is removed. 

This could be done by checking at the time of access thru the invalid
iterator, rather than by checking during deletes.

For efficiency, keep track in each iterator and each list head the
number of deletes (or other operations that might invalidate an
iterator) that have occurred. If an iterator is accessed when that
counter in the iterator is smaller than the counter in the list it's
iterating, run through the list (O(N)) and check if the iterator is
pointing to one of the still-existant nodes.

It's a performance trade-off that works well when you're doing a lot of
list manipulations with few iterators per list, which I would assume is
a common case.

-- 
Darren New 
San Diego, CA, USA (PST). Cryptokeys on demand.
   You will soon read a generic fortune cookie.



  parent reply	other threads:[~2001-12-06 17:47 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-05  0:08 List container strawman 1.3 Ted Dennison
2001-12-05  0:26 ` Ted Dennison
2001-12-05  1:31   ` Vincent Marciante
2001-12-05  8:35   ` Jean-Marc Bourguet
2001-12-05 15:02     ` Ted Dennison
2001-12-05 13:22   ` John English
2001-12-05 16:42     ` Ted Dennison
2001-12-05 21:22       ` Mark Lundquist
2001-12-05 21:38         ` Mark Lundquist
2001-12-05 22:42         ` Ted Dennison
2001-12-05 23:59           ` Mark Lundquist
2001-12-06 14:50             ` Iterator approach (was: List container strawman 1.3) Ted Dennison
2001-12-06 16:19               ` Ted Dennison
2001-12-06 17:41               ` Mark Lundquist
2001-12-06 17:57                 ` Preben Randhol
2001-12-07 16:19                 ` Ted Dennison
2001-12-06 17:47           ` Darren New [this message]
2001-12-07 16:00             ` List container strawman 1.3 Ted Dennison
2001-12-07 17:18               ` Darren New
2001-12-09 14:04                 ` Mark Lundquist
2001-12-05 16:44     ` Simon Wright
2001-12-05  2:57 ` Jeffrey Carter
2001-12-05  3:45   ` Ted Dennison
2001-12-05  6:01     ` Jeffrey Carter
2001-12-05 13:17 ` John English
2001-12-05 15:46   ` Ted Dennison
2001-12-05 18:03     ` Georg Bauhaus
2001-12-05 18:30       ` Ted Dennison
2001-12-06 13:56         ` Georg Bauhaus
2001-12-06 14:59           ` Ted Dennison
2001-12-06  0:18       ` Jeffrey Carter
2001-12-06 13:52         ` Georg Bauhaus
2001-12-06 16:56           ` Jeffrey Carter
2001-12-06 19:33             ` Georg Bauhaus
2001-12-07 16:22               ` Ted Dennison
2001-12-05 16:53   ` Ted Dennison
2001-12-05 17:09   ` Larry Kilgallen
2001-12-06 23:07 ` Nick Roberts
replies disabled

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