[kaffe] gnu.java.nio.VMSelector implementation

Guilhem Lavaux guilhem at kaffe.org
Sun Apr 3 04:10:44 PDT 2005


Hi Rei,

Thank you very much for the patch ! It looks good to me. The last two
files should also be sent to GNU Classpath though. As they are trivial
bugs I think there should not be any problem going into the CVS.

I am committing this now.

Regards,

Guilhem.

On Sun, 2005-04-03 at 17:04 +0900, Rei Odaira wrote:
> Dalibor Topic wrote:
> > Rei Odaira wrote:
> > > Hi,
> > > 
> > > I'm trying to run Tomcat 5 with clustering support on Kaffe/jthread.
> > > 
> > > The current implementation of gnu.java.nio.VMSelector#select()
> > > seems to directly invoke a system call "select()", instead of KSELECT().
> > > Since the system call is not aware of jthread, Kaffe can stop
> > > indefinitely when java.nio.channels.Selector#select() is called
> > > with timeout == 0 (blocking mode).
> > > 
> > > Below is a simple testcase.
> > > 
> > > I think the previous implementation, which uses KSELECT(), would be better,
> > > although it has several serious bugs.
> > > Any thoughts?
> > 
> > Konnichiwa Rei,
> > 
> > Thanks you very much for spotting this bug, and for the great bug 
> > report! And thanks to Guilhem for checking in a fix so rapidly and 
> > fixing my mistake! :)
> 
> Thanks to Guilhem for fixing the issue!
> 
> But unfortunately, this is not the end of the problem.
> The attached patch will fix the following five bugs
> in the selector of Kaffe/jthread.
> 
> o The parameter "e" of jthreadedSelect() can be NULL,
>   which means an infinite timeout. In that case,
>   time_milli should be NOTIMEOUT.
> 
> o We must not pass parameters "b", "c", and "d" of
>   jthreadedSelect() directly to the system call select(),
>   because they can be changed by select().
> 
> o We must set maxFd, readsPending, and writesPending properly
>   in jthreadedSelect().
> 
> o helper_select() in gnu_java_nio_VMSelector.c retuns EINTR
>   when the current thread is interrupted.
>   However, EINTR == 4 in Linux, so we cannot distinguish
>   the interrupted case from the one where the number of bits
>   set in the bit masks is 4.
> 
> o java.nio.channels.spi.AbstractSelectableChannel#register()
>   should throw IllegalBlockingModeException if the channel is
>   in blocking mode.
> 
> Rei





More information about the kaffe mailing list