Subj : pthread_mutex_lock -> sem_unlink -> pthread_create? To : comp.programming.threads From : usenet Date : Mon Jun 20 2005 10:43 am I'm having a strange problem that I haven't been able to find a reference to on usenet or the web. A program of ours is experiencing very high load when processing very little network traffic. Attaching to one of the busy threads consistently gives backtraces like the one below. I don't understand why pthread_create is being called here. Is this normal behaviour from pthread_mutex_lock? Hundreds of threads are being created, according to the output of repeated ps, which clearly isn't right. I don't know whether this is a problem with the way we're using ZThread, a bug in ZThread, or a bug in glibc's pthread, and I'm at a brick wall now. Can anyone shed any light on this odd situation? I'm using glibc 2.3.2 on Linux 2.4.26 SMP (2 x HT CPUs). #0 0x4166da35 in pthread_getconcurrency () from /lib/i686/libpthread.so.0 #1 0x4166cdb8 in pthread_create () from /lib/i686/libpthread.so.0 #2 0x4166f210 in sem_unlink () from /lib/i686/libpthread.so.0 #3 0x4166bd77 in pthread_mutex_lock () from /lib/i686/libpthread.so.0 #4 0x4025c96c in ZThread::FastLock::acquire() () from /usr/lib/ipaccess/bsc/lib/libzthread.so #5 0x40260e60 in ZThread::FastMutex::acquire() () from /usr/lib/ipaccess/bsc/lib/libzthread.so #6 0x0829d1e6 in SmartPtr::removeReference() () #7 0x0829bf4b in SmartPtr::~SmartPtr() () #8 0x40727e6b in TcpConnectionSubServer::readAnyIcomingMessagesPending() () from /usr/lib/ipaccess/bsc/lib/libipa_sockmgnt.so #9 0x40725bb8 in TcpConnectionSubServer::run() () from /usr/lib/ipaccess/bsc/lib/libipa_sockmgnt.so #10 0x4026a8a8 in ZThread::Holder::run() () from /usr/lib/ipaccess/bsc/lib/libzthread.so #11 0x4026b8a4 in ZThread::ThreadImpl::dispatch(ZThread::ThreadImpl*, ZThread::ThreadImpl*, ZThread::CountedPtr const&) () from /usr/lib/ipaccess/bsc/lib/libzthread.so #12 0x4026d016 in ZThread::Launcher::run() () from /usr/lib/ipaccess/bsc/lib/libzthread.so #13 0x4026f058 in _dispatch () from /usr/lib/ipaccess/bsc/lib/libzthread.so #14 0x4166b881 in pthread_detach () from /lib/i686/libpthread.so.0 Thanks, Dan. .