Why is Linux thread locking so slow?
Tom Tromey
tromey@cygnus.com
Tue Oct 19 11:10:00 GMT 1999
>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:
Jeff> Besides, the GC attempts to suspend all threads during
Jeff> collection, so collection locks really shouldn't need to be
Jeff> used.
You need them to avoid a race when two threads decide to GC around the
same time.
Jeff> System calls should be unnecessary on an adequate MP machine,
Jeff> unless the queue becomes full or empty. Lock contention should
Jeff> be low, though I'd like to try it with spinlocks alone to see if
Jeff> it runs noticeably better.
I guess it would be possible to extend libgcj so that you can specify
spinlock or pthread mutex on a per-object basis (via some nonportable
hack). I doubt this is really worthwhile.
I'm also not enthused about writing our own 2-level thread system just
to work around problems in Linux. I'd rather Linux be fixed. I don't
have the time or knowledge to argue about this with the kernel
hackers, though. Bummer.
Tom
More information about the Java
mailing list