comp.lang.ada
 help / color / mirror / Atom feed
From: ezkcdude <zamir.evan@gmail.com>
Subject: Re: Memory mapped files and shared memory (Was: Newbie Needs Ada Advice)
Date: 11 May 2007 09:38:38 -0700
Date: 2007-05-11T09:38:38-07:00	[thread overview]
Message-ID: <1178901518.742268.38300@w5g2000hsg.googlegroups.com> (raw)
In-Reply-To: <ygetzukbcks.fsf_-_@hugsarin.dmusyd.edu>

On May 10, 4:20 pm, Jacob Sparre Andersen <spa...@nbi.dk> wrote:
> Markus E Leypold wrote:
> > Jacob Sparre Andersen <spa...@nbi.dk> writes:
> >> File names are slow.  Wouldn't it be more appropriate to keep the
> >> currently relevant image(s) in a shared memory segment?
>
> > Dependents on what you want to do. Probably not the whole 30 GB. My
> > rule of thumb always is to do the elementary thing first and
> > optimize later.
>
> In general that is also what I do, but isn't it simpler to store the
> whole sequence of images in an array of images?  Mapping that array
> into a file/shared memory segment costs you around 20 lines of code
> (even with my rather extravagant use of linebreaks).
>
> There is one catch: I am not sure that the Ada interface to POSIX
> systems is required to support memory maps as large as 30 Gb.
> (Additionally I suspect that the original poster isn't using a POSIX
> system.)
>
> > In this case one could use the file storage (one use it anyway),
> > introduce (when required) the shared memory for explicit caching (or
> > perhaps play with memory mapping the file) and refine the
> > get-the-image protocol appropriately. My gut feeling though is, to
> > trust the file system cache of the machine to do the proper caching
> > implicitely and there should be a good reason to think you can do
> > better than that manually.
>
> Using memory maps goes even further in leaving the caching/swapping
> decisions to the operating systems, than copying individual images to
> and from files.
>
> Greetings,
>
> Jacob
> --
> recursive, adj.; see recursive

So, what's the bottom line? If my application needs to write images as
fast as possible to disk, how should one go about doing that? And is
Ada as good as any other low-level programming language for this task?

On a related topic, would it be helpful to have very fast hard drives
in a RAID 0 configuration? I'm wondering if that would automatically
speed up things, or would I have to somehow take advantage of that in
the Ada program...




  reply	other threads:[~2007-05-11 16:38 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03 17:13 Newbie Needs Ada Advice ezkcdude
2007-05-03 18:24 ` Dmitry A. Kazakov
2007-05-03 22:14   ` ezkcdude
2007-05-04  4:07 ` tmoran
2007-05-04 12:57   ` Bob Spooner
2007-05-04 13:38     ` Dmitry A. Kazakov
2007-05-04 14:40       ` ezkcdude
2007-05-04 19:19       ` Bob Spooner
2007-05-04 19:48         ` Dmitry A. Kazakov
2007-05-06 21:46           ` ezkcdude
2007-05-07  7:31             ` Dmitry A. Kazakov
2007-05-07  7:42             ` Alex R. Mosteo
2007-05-07  9:15               ` Dmitry A. Kazakov
2007-05-08  2:58             ` Justin Gombos
2007-05-08 11:58               ` ezkcdude
2007-05-04  4:42 ` Jeffrey R. Carter
2007-05-04  6:48 ` Jacob Sparre Andersen
2007-05-07  8:01 ` Markus E Leypold
2007-05-08 14:40   ` ezkcdude
2007-05-08 15:07     ` Pascal Obry
2007-05-08 15:27       ` ezkcdude
2007-05-08 15:54         ` Pascal Obry
2007-05-08 16:07         ` Georg Bauhaus
2007-05-08 18:42           ` Markus E Leypold
2007-05-08 16:18         ` Ali Bendriss
2007-05-08 19:23         ` Michael Bode
2007-05-08 16:11     ` Markus E Leypold
2007-05-08 16:49       ` ezkcdude
2007-05-08 18:20         ` Ludovic Brenta
2007-05-08 21:17           ` Markus E Leypold
2007-05-08 18:45         ` Markus E Leypold
2007-05-08 18:28     ` Alex R. Mosteo
2007-05-08 18:51       ` ezkcdude
2007-05-08 19:31         ` Michael Bode
2007-05-08 19:43           ` Michael Bode
2007-05-08 20:02         ` Dmitry A. Kazakov
2007-05-08 21:26           ` Markus E Leypold
2007-05-08 21:21         ` Markus E Leypold
2007-05-08 21:27           ` ezkcdude
2007-05-08 21:56             ` Markus E Leypold
2007-05-09 13:25               ` Jacob Sparre Andersen
2007-05-09 15:58                 ` Markus E Leypold
2007-05-10 21:20                   ` Memory mapped files and shared memory (Was: Newbie Needs Ada Advice) Jacob Sparre Andersen
2007-05-11 16:38                     ` ezkcdude [this message]
2007-05-10 18:14     ` Newbie Needs Ada Advice Chip and Allie Orange
2007-05-27  5:50     ` adaworks
2007-05-29 12:54       ` ezkcdude
replies disabled

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