Date: Thu, 24 Aug 2000 13:10:46 +0300 From: "Ari Suutari" <ari@suutari.iki.fi> To: "Gary Howland" <gary@abc.aaa-mainstreet.nl> Cc: <freebsd-java@FreeBSD.ORG>, <jdricot@ulb.ac.be> Subject: Solved: JDK 2 Patchset 10 + FreeBSD_CommAPI Message-ID: <00da01c00db3$9261bd80$0e05a8c0@intranet.syncrontech.com> References: <Pine.BSF.4.21.0008231558550.94188-100000@abc.aaa-mainstreet.nl> <00ce01c00d9a$bce31fe0$0e05a8c0@intranet.syncrontech.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi again (I feel like talking to myself already....)
Just got things working with patchset 10. The problem is that
FreeBSD_CommAPI uses select(2), which is no longer overrided
by green threads package. The select support of green threads
is behind #ifdef USE_SELECT (see
src/freebsd/hpi/green_threads/src/iomgr.c),
which seems to defined by Makefiles only if FreeBSD version is old
enough (there seems to be a condition for it in Defs-freebsd.gmk).
So I came up with two different solutions:
1) Modify CommAPI so that it uses poll instead of select. I have done
this and tested it and it seems to work OK.
2) Modify JDK for next patchset so that a wrapper for select is
provided by green threads. Maybe this would be a good thing,
since there may be other JNI code out in the world which relies
on select and omission for wrapper causes such code to fail.
Ari S.
>
> >
> > It was nothing to do with threads, more to do with using the wrong flags
> > with termio
> >
>
> The termio stuff seems to need some polising. There seems to
> be a fcntl call to setup SIGIO delivery, but the signal is not handled
> anywhere. Also, what might be the idea behind VMIN & VTIME
> settings, I'm not sure that the current selection is the best one.
>
> However, what is causing my problem is really that other threads
> are not running when JNI code sits in a loop periodically calling
> select(2). Partial fix seems to be to call Thread.yield inside
> that loop, but even with that, the threads are scheduled in a manner
> that is far away from perfect.
>
> When I look at JDK sources how, for example, a read from socket
> is implemented, it seems to be so that it calls JVM_Read which
> in turn calls sysRead, which in turn calls a wrapper provided by
> green threads package.
>
> So, shouldn't the JNI stuff in comm package
> (libSerial.so) be linked against green threads wrappers somehow
> to make things really work ?
>
> 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?00da01c00db3$9261bd80$0e05a8c0>
