On 9 Jun 2009, at 01:22, Robert Poor wrote in 'implementing a "wait for signal with timeout"':
I am not sure exactly how 'chuck' does memory allocations, but I avoid allocate any reference types in the threads. I have had the program running for long time. Are you saying the threads themselves are leaking?
Essentially, yes: sporking a shred eats up 88.3K of non-recovered memory. It's easy to show with this bit of code:
There is an interesting way to reuse threads, as in the attached
example. Though it is written for Posix threads (pthreads), it might
be an input to 'chuck' too. Compile it using
gcc psearch.c -lpthread -o psearch
The program is run as
./psearch <string>