[kaffe] kaffe JNI Problem
Godmar Back
gback at cs.utah.edu
Mon Jun 24 17:00:41 PDT 2002
>
> Hello,
>
> I have following JNI problem with the Kaffe:
>
> I run from my C-code a kernel process. With other JVM it works
> correctly, the user application waits, up to kernel process will be
> ended. Kaffe doesn't wait. Example,
>
> info = hci_inquiry(peer->devid, inqSecs, &noDevs, NULL, 0); //a kernel
> process. It takes 30 sec
>
> kaffe doesn't wait. In one second an error will be printed.
>
> if (info == NULL) {
> error (env,"Delay ???");
> return NULL;
> }
>
>
> What is wrong ???
>
Nothing, presumably. In general, you can't expect JNI code that was
written for one JVM to work with another JVM.
I would guess that hci_inquiry relies on being blocked in a system
call and doesn't handle the EINTR properly, which it will invariably get
from the various SIGs ordered by Kaffe's jthreads.
You can either port your application's system calls to use the jsyscall
interface, or you can try to use kaffe with native threads (don't know
the current status of that - and it would still be iffy), or you can try
to avoid the problem altogether by doing your C activities in a different
process and communicating through standard pipes/sockets - if your OS
supports that and if you don't have performance constraints
then I would recommend going that path. (You don't have performance
constraints, otherwise you would be using Kaffe...)
- Godmar
More information about the kaffe
mailing list