Subj : pthread_create() cannot allocate memory with signal handling? To : comp.programming.threads From : kuang_cao Date : Sun Sep 18 2005 07:55 pm Hi, I am working on an application running on Redhat Linux and it uses pthread for part of the calculation. There are two processes in the code, basically one for GUI and one for calculation. The calculation process also creates thread to achieve parallel computation. The GUI process handles signals from a parallel port. The calculation process and the GUI process communicate with each other via socket. In the code, I only have six threads running at the same time, and they basically process data simultaneously, once they all finish processing data, the threads are joined to synchronize them. But the data comes in volumes, and for each volume 6 threads are created/joined, and typically, each run has about 150 volumes. The program runs ok with small number of runs, but if I run it continously while having the GUI process handling signals, it crashes with error code 12 "Cannot allocate memory" after about 20 runs. The interesting thing is that it runs ok even till 35 runs if the GUI process doesn't handle signals. I don't know whether there is any conflict between pthreads and signal handling, but that doesn't make much sense since the threads are created in calculation process while signal handling happens in GUI process. Does anybody have comments or suggestions about this? Could the "Cannot allocate memory" error be actually from something else, and this is just an innocent bystander? Am I hitting the maximum threads allowed? Thanks a lot. .