nio package and asynchronous io
Cedric Berger
cedric@wireless-networks.com
Mon Feb 4 12:10:00 GMT 2002
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
>
More information about the Java
mailing list