Hey all,
After doing some testing on my gphoto code I realized that the patch would only run for exactly 238 runs. After that pthread_create() refuses to create another thread (returns 11).
I even pared down the thread to do nothing but sending out a bang and exiting the thread. (attached)
I'm exiting the thread, the thread is not even allocating any memory, why does it stop?
I realized I did not enable threading when compiling PD, and now I don't see that option at all in configure. Do I have to use the svn PD version? I'm currently using Millers .40-2.
Any tips appreciated.
Thanks, B. Bogart
On Wed, 25 Mar 2009, B. Bogart wrote:
After doing some testing on my gphoto code I realized that the patch would only run for exactly 238 runs. After that pthread_create() refuses to create another thread (returns 11). I even pared down the thread to do nothing but sending out a bang and exiting the thread. (attached) I'm exiting the thread, the thread is not even allocating any memory, why does it stop?
I don't really know that stuff, but do you need to call pthread_join on the dead thread? Or is there any other cleanup that needs to be done after a pthread_exit? (a return from the thread is an implicit pthread_exit)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
Well,
I dropped out all the PD and gphoto code.
Low and behold, plain C bails after exactly 238 thread executions.
So I'm doing something wrong in the pthread stuff.
Onto more general sources of info.
.b.
Mathieu Bouchard wrote:
On Wed, 25 Mar 2009, B. Bogart wrote:
After doing some testing on my gphoto code I realized that the patch would only run for exactly 238 runs. After that pthread_create() refuses to create another thread (returns 11). I even pared down the thread to do nothing but sending out a bang and exiting the thread. (attached) I'm exiting the thread, the thread is not even allocating any memory, why does it stop?
I don't really know that stuff, but do you need to call pthread_join on the dead thread? Or is there any other cleanup that needs to be done after a pthread_exit? (a return from the thread is an implicit pthread_exit)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
On Thu, 26 Mar 2009, B. Bogart wrote:
I don't really know that stuff, but do you need to call pthread_join on the dead thread?
Low and behold, plain C bails after exactly 238 thread executions. So I'm doing something wrong in the pthread stuff. Onto more general sources of info.
Let me restate the same question: do you need to call pthread_join on the dead thread?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
join us used for blocking the calling thread:
"The pthread_join() subroutine blocks the calling thread until the specified threadid thread terminates." https://computing.llnl.gov/tutorials/pthreads/
I don't need to wait for the thread. It should take as long as it takes, independent of the calling function.
I can't see to find a pthread mailinglist, any recommendations on where to ask?
.b.
Mathieu Bouchard wrote:
On Thu, 26 Mar 2009, B. Bogart wrote:
I don't really know that stuff, but do you need to call pthread_join on the dead thread?
Low and behold, plain C bails after exactly 238 thread executions. So I'm doing something wrong in the pthread stuff. Onto more general sources of info.
Let me restate the same question: do you need to call pthread_join on the dead thread?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
It seems that the default thread attributes are joinable.
Since I want detached threads I had to manually set the attribute!
I'm testing with a camera now, but my test code in C, and PD external without the gphoto calls got to 6000 iterations fine.
Mathieu, thanks for making me re-read the pthread_join stuff!
If this test is successful I'll commit these changes.
.b.
Mathieu Bouchard wrote:
On Thu, 26 Mar 2009, B. Bogart wrote:
I don't really know that stuff, but do you need to call pthread_join on the dead thread?
Low and behold, plain C bails after exactly 238 thread executions. So I'm doing something wrong in the pthread stuff. Onto more general sources of info.
Let me restate the same question: do you need to call pthread_join on the dead thread?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec
On Thu, 26 Mar 2009, B. Bogart wrote:
Mathieu, thanks for making me re-read the pthread_join stuff!
although I have never really used pthread, I thought about this thing because in UNIX you have to use wait() on terminated processes that you have started, else they stick in the process-table of the kernel as "zombies", which just means that the processes just stay alive for the sake of being joined. That's all.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal, Québec