harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regis <xu.re...@gmail.com>
Subject Re: [jira] Created: (HARMONY-6328) [classlib][nio] optimize SocketChannel.write(ByteBuffer[], int, int) by writev
Date Mon, 28 Sep 2009 05:26:51 GMT
Tim Ellison wrote:
> On 24/Sep/2009 06:05, Regis wrote:
>> Tim Ellison wrote:
>>> On 18/Sep/2009 08:58, Regis wrote:
>>>> I applied the improvements at r816508 and closed the JIRA.
>>> Great.  I assume it is just me, but I'm running with the IBM VME and see
>>> a failure in the new test:
>>>
>>>> java -version
>>> Apache Harmony Launcher : (c) Copyright 1991, 2009 The Apache Software
>>> Foundation or its licensors, as applicable.
>>> java version "1.4.2 subset"
>>> Harmony Virtual Machine Element (2.3)
>>> J9 (2.3)
>>> IBM J9 2.3 Windows XP x86-32  (JIT enabled)
>>> J9VM - 20060727_07300_lHdSMR
>>> JIT  - 20060727_1808_r8
>>> GC   - 20060724_AA
>>>
>>> produces
>>>
>>> (10038) An operation was attempted on something that is not a socket.
>>>
>>> java.net.SocketException: (10038) An operation was attempted on
>>> something that is not a socket.
>>> at org.apache.harmony.luni.platform.OSNetworkSystem.writev(Native Method)
>>> at
>>> org.apache.harmony.nio.internal.SocketChannelImpl.writevImpl(SocketChannelImpl.java:554)
>>>
>>> at
>>> org.apache.harmony.nio.internal.SocketChannelImpl.write(SocketChannelImpl.java:530)
>>>
>>> at
>>> org.apache.harmony.nio.tests.java.nio.channels.SocketChannelTest.test_writev(SocketChannelTest.java:2673)
>>>
>>> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25)
>>>
>>> I'll try to recreate on DRLVM and open a JIRA if it is still failing
>>> for me.
>>>
>>> I have written a number of new tests for this code too, but they'll have
>>> to wait until I get past this one :-)
>>>
>>> Regards,
>>> Tim
>>>
>>>
>>>
>> I found the failures only happened when buffers contained direct buffer,
>> after further investigation, (*env)->GetDirectBufferAddress always
>> return 0 in IBM VME. Maybe IBM VME doesn't support this JNI call or
>> doesn't recognize Harmony direct buffer implementation?
> 
> Ah, I expect it is that the VME doesn't work with the Harmony NIO
> implementation yet.  Things were working ok with the DRLVM so I went
> ahead and committed my enhanced tests.  I'm happy to say they all worked
> perfectly with your optimizations too, good work!  :-)
> 
> Regards,
> Tim
> 

It's a little sad it will break VME. I thought two ways to fix this:

1. add new parameter long[] to writev, which contains native address of direct 
buffer, but the parameters will be a little long.

2. wrap native address to Long which can be filled in Object[], but this may 
need reflections to get each value of Long.

Both of them are not so good....

-- 
Best Regards,
Regis.

Mime
View raw message