libjava and gthreads

Tom Tromey
Tue Jan 15 10:13:00 GMT 2002

>>>>> "Adam" == Adam Megacz <> writes:

Adam> libjava seems to have reimplemented a lot of this functionality
Adam> for POSIX (and now, Win32). Would it make more sense to just
Adam> call the gthreads functions in order to reduce the amount of
Adam> platform-specific code in libjava?

I think gthreads is insufficient for our needs.  It doesn't provide
condition variables or any way to interrupt another thread.
Implementing these things on top of it would mean breaking the
abstraction barrier.  At that point we might as well do our own thing.
Doing our own layer also provides us with some flexibility.  For
instance this let us implement faster mutexes.

There's also a historical reason: way back when we first implemented
threads, libgcj wasn't part of gcc.  At that time using an internal
gcc interface didn't seem like a good idea.  It still might not be
looked upon well by the gcc maintainers -- maybe they want to keep
gthread private so they don't have to worry about changing it.


More information about the Java mailing list