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: Why is Linux thread locking so slow?


>>>>> "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

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