This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Why is Linux thread locking so slow?
- To: Matt Welsh <mdw at cs dot berkeley dot edu>
- Subject: Re: Why is Linux thread locking so slow?
- From: Tom Tromey <tromey at cygnus dot com>
- Date: Fri, 8 Oct 1999 13:51:20 -0700
- Cc: java-discuss at sourceware dot cygnus dot com, java-linux at java dot blackdown dot org
- References: <199910081944.MAA21271@mnemosyne.CS.Berkeley.EDU>
>>>>> "Matt" == Matt Welsh <mdw@cs.berkeley.edu> writes:
Matt> However, I can't seem to duplicate the same problem when writing
Matt> a simple pthreads program in C -- the C program performance
Matt> doesn't decrease anywhere near as badly as Java. I believe I am
Matt> using the same locking mechanisms in C as are used in GCJ.
They are basically the same. Any difference should be much smaller
than the effect you are seeing.
Someone (I don't remember who) has said here that Linux Threads uses
spin locks for mutexes -- apparently it doesn't yield when trying to
acquire a lock. I haven't looked at the source to see if this is the
case, but if it is then it would seem to explain your problem.
Tom