system scope threads entering STOP state

Guy Helmer ghelmer at
Thu Jul 14 16:25:25 GMT 2005

I have a long-running multithreaded process on FreeBSD 5.4 (SMP, 
PREEMTPION, SCHED_4BSD) linked with libpthread and I'm creating the 
threads with attribute PTHREAD_SCOPE_SYSTEM.  The threads need to be 
processing input in near-real-time or its input buffers overflow.

I've modified the program so that a thread can fork/execl/waitpid 
(without WNOHANG) to use an external program for further processing on a 
batch of input (sometimes via a pipe, other times via writing to a 
file).  However, even under a light input load, the program is now 
dropping input.  While running top(1) in thread mode, I occasionally 
find all the program's threads are in the STOP state for several 
consecutive seconds.  Is there anything related to the frequent use of 
fork, execve, or wait4 that would be likely to cause such a situation?  
I'm not seeing anything obvious in my reading of the kernel sources.

Thanks in advance for any help,

Guy Helmer, Ph.D.
Principal System Architect
Palisade Systems, Inc.

More information about the freebsd-threads mailing list