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

pthreads + memory

Few questions about pthreads on devboard_lx: 

-I found that I could create at most 46 pthreads. 
if i try to create more, i get errno=4 from pthread_create, which is
interrupted system call (EINTR). Is there actually a signal being
delivered to the process? I tried to install a handler for most of the
signals, but they weren't caught. 

I think though, that this is because of lack of memory (I have other apps.
running on the board at the same time).

-I am probably wrong - I calculated that there is
approximately 70-80KB worth of memory overhead associated with one pthread
(which seems ridiculously high). Does anyone know how much overhead
there actually is?

-In case this is a problem of lack of memory, I dont know if it is
possible to determine that we are out of memory, and return EAGAIN
instead of EINTR- I had asked the same question previosuly about malloc -
malloc returns successfully 
even if memory is not available, since physical memory does not get
allocated till you do a write....