This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Serious problem with multithreaded I/O on Linux


Tom Tromey wrote:

> >>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
>
> Bryce> On Linux (using Redhat 6.0/glibc 2.1.1-6), Calling a blocking
> Bryce> I/O method [eg: anything that eventually calls
> Bryce> FileDescriptor.read()] causes many calls from all other threads
> Bryce> to block also. This makes multithreaded I/O (ie: reading from
> Bryce> two sockets simultaneously) completely
> Bryce> unreliable/impossible. Other things, like starting a new
> Bryce> thread, do not work while the read() method is blocking.
>
> Actually, my guess is that we aren't compiling
> natFileDescriptorPosix.cc with _REENTRANT defined.
> This is just a piece of configure lossage; I think we ought to define
> this when using pthreads.
>
> Could you try rebuilding libgcj with -D_REENTRANT?  If that works,
> I'll write a fix tomorrow.

Yeah, that was the first thing I checked. It looks okay to me:

[...]
/bin/sh ./libtool --mode=compile c++ -DHAVE_CONFIG_H -I.
-I../../../libjava -I./include -Iinclude -I../../../libjava/include
-I../../../libjava/../boehm-gc -I./../boehm-gc  -DLINUX_THREADS=1
-D_REENTRANT=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_DEBUGGING=1
-DJAVA_FINALIZATION=1   -I../../../libjava/../compat-include
-I../../../libjava/../zlib   -fno-rtti -fvtable-thunks   -ffloat-store -W
-Wall -g -O2 -fvtable-thunks -D_GNU_SOURCE -c -o
java/io/natFileDescriptor.lo java/io/natFileDescriptor.cc
rm -f java/io/.libs/natFileDescriptor.lo
c++ -DHAVE_CONFIG_H -I. -I../../../libjava -I./include -Iinclude
-I../../../libjava/include -I../../../libjava/../boehm-gc -I./../boehm-gc
-DLINUX_THREADS=1 -D_REENTRANT=1 -DSILENT=1 -DNO_SIGNALS=1
-DNO_DEBUGGING=1 -DJAVA_FINALIZATION=1
-I../../../libjava/../compat-include -I../../../libjava/../zlib -fno-rtti
-fvtable-thunks -ffloat-store -W -Wall -g -O2 -fvtable-thunks
-D_GNU_SOURCE -c  -fPIC -DPIC java/io/natFileDescriptor.cc -o
java/io/.libs/natFileDescriptor.lo
[...]

regards

  [ bryce ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]