On Dec 5, 2006, at 2:52 AM, Andrew Haley wrote:

Mark Wielaard writes:
Hi,

On Tue, 2006-12-05 at 11:04 +0100, Roman Kennke wrote:
Except that you should probably also check if the thread was interrupted
as the original patch does for read and write.

I did it like that and it solved all my problems :-)

But surely you have the same problem with any other callers of
cpio_connect, or indeed cpio_*. You only fixed the bug in one place.

Yeah I agree. I was wondering the same, but I decided to follow what
Mark did and fix it in VMChannel. Maybe should pull all these fixes into
javanio.c then?

The only consumer is VMChannel.

If you're going to loop around connect(2), you surely want to do so as
close to the syscall as possible.


The cpnio functions are (should be) trivial and inlined. What more is needed?

Now, is VMChannel supposed to be POSIX-specific or not?  If it is

Yes, it is.

supposed to be POSIX-specific, and there seem to be an awful lot of
POSIXisms in there, why is it using cpio_connect() instead of simply
connect(2)?  I guessed that cpio_connect() was supposed to be a
platform-independent abstraction on a syscall, but it isn't being used
to do that: VMChannel.c isn't platform-independent.  So cpio_connect()
is useless, isn't it?


No. This was trying to address the issues VM implementors had when it comes to user-space threads: syscalls that we use that can block indefinitely are wrapped in an easy-to-replace implementation, but otherwise the code assumes a POSIXy system.

We went through this before. I thought we had enough of a consensus that POSIX was a good enough abstraction for our reference implementation of the native code, as long as we left hooks like this in place for VMs when it comes to blocking IO calls. You'll notice that we don't do this for other functions that (according to the documentation) won't block.

Maybe I'm mistaken here. I'd like to hear opinions again from VM implementors on how well the cpnio stuff works for them. I think JikesRVM and Kaffe were the ones that offered user-space threading.

native/jni/java-nio/javanio.h explains all of this.

Reply via email to