Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Advocacy > Re: What happen...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 10 Topic 2408 of 2456
Post > Topic >>

Re: What happened to Double Buffering?

by The Ghost In The Machine <ewill@[EMAIL PROTECTED] > Jul 1, 2008 at 02:00 PM

In comp.lang.java.advocacy, Roedy Green
<see_website@[EMAIL PROTECTED]
>
 wrote
on Tue, 01 Jul 2008 02:39:05 GMT
<146j64hrfa5evrkgmd6fg85a4i82u0je5l@[EMAIL PROTECTED]
>:
> On Tue, 24 Jun 2008 11:30:45 -0700, The Ghost In The Machine
> <ewill@[EMAIL PROTECTED]
> wrote, quoted or indirectly quoted
> someone who said :
>
>>I can do one better, though I rarely bother (I've seen
>>it done by a co-worker though); one can set up a virtual
>>memory area that is associated with a file, and then access
>>the area using char* pointers.  The file load in this case
>>is done on an incremental basis, with pages faulting in as
>>needed.  (mmap()/mmap2(), mremap(), munmap().)
>
> that would do well if you were processing only part of the file, but
> if you were processing every byte, then one giant i/o to read the whol
> thing would do better.  Otherwise you could get a physical I/O per 2K
> or so, not even as good as a BufferedReader.

I'd frankly have to look, and it may depend on OS.  Apart
from an optimization thing (if one open()s the file the OS
might assume readahead; mmap() might cause the OS to assume
entirely random), I don't see that much of a difference,
from a pure performance standpoint.

Then again, I've not done benchmarks.

Three other drawbacks, all roughly based on the system
I'm using internally (a template C++ affair):

[1] If one stores data structures in a file using mmap(),
one is obliged to ensure that the pointer returned by
mmap() is properly processed.  In particular, if mmap()
returns a different pointer the structures won't work if
simple pointers are used.  Two workarounds are possible:
offsets and self-relative pointers.  Both are flawed.
A third solution would require a prepass and is rather
ugly; the old pointer is stored somewhere in the file and
all known pointers adjusted upon initial load.

[2] The workarounds in [1] extract additional processor
time; either one has to add to a base, or subtract two
pointers, when doing a dereference.  Since one is "reading"
from a file anyway, this may not be a serious issue.

[3] The structures are by necessity processor-specific.
If a file is saved on an mk680x0 and loaded by an ix86,
conversion needs to happen.  ASCII I/O doesn't have this
problem (though it has other issues).

-- 
#191, ewill3@[EMAIL PROTECTED]
 memory has to be one of the most UNconventional
architectures I've seen in a computer system.
** Posted from http://www.teranews.com
**
 




 10 Posts in Topic:
What happened to Double Buffering?
Roedy Green <see_websi  2008-06-23 01:54:08 
Re: What happened to Double Buffering?
Daniel Pitts <newsgrou  2008-06-22 21:50:13 
Re: What happened to Double Buffering?
Roedy Green <see_websi  2008-06-24 09:15:06 
Re: What happened to Double Buffering?
Roedy Green <see_websi  2008-06-24 09:53:25 
Re: What happened to Double Buffering?
The Ghost In The Machine   2008-06-24 11:30:45 
Re: What happened to Double Buffering?
Lew <lew@[EMAIL PROTEC  2008-06-26 08:07:21 
Re: What happened to Double Buffering?
Roedy Green <see_websi  2008-07-01 02:39:05 
Re: What happened to Double Buffering?
The Ghost In The Machine   2008-07-01 14:00:00 
Re: What happened to Double Buffering?
Daniel Pitts <newsgrou  2008-06-24 13:04:34 
Re: What happened to Double Buffering?
Tim Smith <reply_in_gr  2008-06-26 03:01:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 3:55:12 CDT 2008.