Date: Fri, 2 Mar 2001 09:23:07 +0200 From: "Ari Suutari" <ari@suutari.iki.fi> To: "Nate Williams" <nate@yogotech.com>, "Jeroen C. van Gelderen" <jeroen@vangelderen.org> Cc: "Nate Williams" <nate@yogotech.com>, "FreeBSD Java" <freebsd-java@FreeBSD.ORG> Subject: Re: Are syscall wrappers needed in JNI? Message-ID: <05bd01c0a2e9$a1b669e0$0e05a8c0@coffee> References: <3A9AE85F.C6F06D96@vangelderen.org><15002.60084.89087.467979@nomad.yogotech.com><3A9EF71F.A13189C6@vangelderen.org> <15006.63617.145790.5705@nomad.yogotech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi,
> Interesting enough, from my memory, select is wrapped in the JVM, but
> poll was not.
I was talking about jdk1.2.2. For the version I was starting to use
commapi, select was not wrapped, but poll was. You can even find
discussion about this on freebsd-java mailing list, I think. If I
remember
correctly the reason for select not being wrapped was that JVM was
internally using poll and thus patchers assumed that there was not need
to wrap select.
> My suspicion is that the wrapping was causing problems,
> and his modification to use 'poll' caused it to call the native poll,
> instead of the wrapped 'select' version, which can cause problems.
> Nate
I think you are wrong on this one. The select was not wrapped and
it caused all threads on JVM to block when it was called by JNI code.
However, poll was wrapped and changing the JNI code to call it
resulted in working system. I even verified this with debugger, the
poll call from JNI code really ends up into wrapped poll version
inside JVM. It works this way because the loader, when loading
.so containing commapi JNI code, looks for function called
"poll" and it finds it from JVM main code so it is resolved to that
instead of the standard version in libc. What this
means that it *IS* safe to call methods that are wrapped by
JVM.
Anyone can verify all this easily with gdb.
Ari S.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05bd01c0a2e9$a1b669e0$0e05a8c0>
