Hello everyone.

I'm currently working on a java project involving native code.  The
problem I have is the following.  I want to do reads in the native code,
and this read is intercepted by libjava.so.  This is fine and usually
works as expected with green threads.  However, in our code we have set
the file descriptor to be non-blocking with ioctl(... FIONBIO ...).  
However java doesn't realize that the file descriptor is nonblocking, and
so doesn't return control flow to the native code until something has been
read (essentially implementing a blocking call to read with nonblocking
read in order to allow other threads to run.

I tried using fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK) too,
because libjava.so does replace the fcntl (whereas it does not replace
ioctl) , but this didn't seem to work either.  Anyone have any ideas on
this?

I've tried using the native threads implementation, but had problems with
it.

Thanks in advance,
Peter Godman

Reply via email to