comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: GUI was Re: why Ada is so unpopular ?
Date: Sat, 24 Jan 2004 01:26:12 -0500
Date: 2004-01-24T01:26:12-05:00	[thread overview]
Message-ID: <-NOdnXxZvcuYjY_dRVn-vg@comcast.com> (raw)
In-Reply-To: <1074885602.416478@master.nyc.kbcfp.com>

Hyman Rosen wrote:

> Also, while programs may treat directory operations as traversal
> of static but potentially large data structures, it's actually
> the case that the directory structure could be changing as the
> program is running. I know of no way to get an atomic snapshot
> of a directory structure.

I do, but you have to have an OS that supports it.  With Multics you 
could create a copy of a directory that you controlled as an atomic 
operation.  It was actually done by creating a new directory entry and 
setting the "copy on write" bits in the new and old directory entries. 
Now if someone modified the original directory while you were walking 
through the new one, the OS basically marked the in memory copy of 
whatever segment of the directory was modified as the copy belonging to 
the old directory, and the copy on disk as owned by the new directory.

That way both atomic operations can be atomic, and neither one actually 
involves allocating (disk or main) memory.

> A standard directory package cannot finesse its way around this,
> or ignore it, especially if it offers iterative traversal.

What I usually do in this case on inferior operating systems ;-) is to 
read the directory in chunks.  For a directory with only a few entries, 
one chunk is the whole directory and you can do things the simple way. 
If the directory is bigger than one chunk you have to do the messy 
version.  Unfortunately, on many operating systems a directory is hashed 
and there is no sorted view of the directory.  If you need to display 
the directory sorted by name, date, or whatever, there is no way to do 
it other than scan the entire directory creating a tree, and then 
display from the tree.


-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




  reply	other threads:[~2004-01-24  6:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-21 15:42 GUI was Re: why Ada is so unpopular ? amado.alves
2004-01-21 19:22 ` Randy Brukardt
2004-01-22 13:42   ` Marin David Condic
2004-01-22 17:48     ` Warren W. Gay VE3WWG
2004-01-22 19:30       ` Jeffrey Carter
2004-01-23 17:37         ` Warren W. Gay VE3WWG
2004-01-23 13:34       ` Marin David Condic
2004-01-23 17:50         ` Warren W. Gay VE3WWG
2004-01-23 19:20           ` Hyman Rosen
2004-01-24  6:26             ` Robert I. Eachus [this message]
2004-01-24  9:37             ` Georg Bauhaus
2004-01-22 19:33     ` Randy Brukardt
2004-01-23 13:38       ` Marin David Condic
2004-01-22 13:26 ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2004-01-22 19:03 amado.alves
2004-01-23 17:55 ` Warren W. Gay VE3WWG
2004-01-21 18:15 amado.alves
2004-01-20 17:55 Robert C. Leif
2004-01-20 18:58 ` Georg Bauhaus
2004-01-20 14:16 amado.alves
2004-01-21 13:22 ` Marin David Condic
2004-01-21 17:28   ` Jeffrey Carter
2004-01-20  4:06 Robert C. Leif
2004-01-20  7:39 ` Preben Randhol
2004-01-20 10:40   ` Georg Bauhaus
2004-01-20 10:59     ` Preben Randhol
2004-01-20 19:42       ` Randy Brukardt
2004-01-20 20:12         ` tmoran
2004-01-21 13:01           ` Marin David Condic
2004-01-21 18:05             ` tmoran
2004-01-21 12:52         ` Marin David Condic
2004-01-20 13:22 ` Marin David Condic
2004-01-20 17:41   ` Warren W. Gay VE3WWG
2004-01-19  4:11     ` Mark Lorenzen
replies disabled

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