[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#233846: pthread_mutex_lock/unlock problem



At Fri, 20 Feb 2004 10:59:14 +0100,
Robert Strycek wrote:
> it seems that locking / unlocking the same mutex by huge number of threads 
> causes dead locks.
> If I create N=1529 threads (probably system-dependent) that continually 
> lock the same (non-recursive) mutex, everything is ok, program runs 
> forever.
> But if I increase the value by one (N=1530), program freezes after few 
> seconds.
> This may be a pthread_self() problem (if it's used in mutex 
> implementation), because I found it returns non-unique id if N>1529.
> (You may try to store pthread_self() value of the main thread in a global 
> variable and assert( ! pthread_equal(main_thread_id, pthread_self()) ) in 
> thread procedure.)

You use kernel 2.4 + linuxthreads (not for 686).  I think this is
problem.  Try to use kernel 2.6 + NPTL.  Debian does not provide
"linuxthreads + 2.4 kernel + 686"-based libc6.  This means that you
don't use even floating stack.  So if you want to fix this problem, I
think you need to use kernel 2.6.

Please test your program which does not become deadlock on kernel 2.6.

I think this bug can be marked as fixed.

Regards,
-- gotom





Reply to: