This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: nio package and asynchronous io
- From: Cedric Berger <cedric at wireless-networks dot com>
- To: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- Cc: Jakob Praher <praher dot keg at liwest dot at>, java at gcc dot gnu dot org
- Date: Mon, 04 Feb 2002 20:08:17 +0100
- Subject: Re: nio package and asynchronous io
- References: <1012842846.637.9.camel@jaques> <87ofj54045.fsf@tf1.tapsellferrier.co.uk> <1012843643.1451.12.camel@jaques> <87it9d3zbe.fsf@tf1.tapsellferrier.co.uk> <1012847493.1450.14.camel@jaques> <87g04h3vzj.fsf@tf1.tapsellferrier.co.uk>
Nic Ferrier wrote:
>Jakob Praher <praher.keg@liwest.at> writes:
>
>>the buffers are actually quite interesting:
>>
>>they provide a new method for dealing with blocks of memory.
>>there are buffer classes for all primitive types, like
>>java.nio.ByteBuffer, java.nio.IntBuffer, ....
>>
>>one of the neat things about the ByteBuffer, is that it can be told to
>>be a direct buffer, which means the memory underlying the buffer is
>>countigous allocated.
>>
>>buffers should help to reduce garbage production, as you can allocate
>>the memory once and reuse it.
>>
>
>Yes. I looked at the buffering in 1.4. I seem to remember they added
>some new bytecode instructions to facilitate handling buffers. Is that
>true?
>
No. they didn't add new bytecodes (at least not in classfiles, what the
VM do internally is
another issue).
OTOH, they added 3 JNI functions to create/access native buffers in
native code.
>I guess they'd be new instructions to deal with contiguous memory
>blocks.
>
No.
Cedric
>I'm cross posting this to the GCJ list, because it might be
>interesting to see what they say about the viability of adding this
>kind of memory allocation (given that GCJ uses the boehm-gc.
>
>
>Nic
>