Hey Thomas,
thanks for the tip. but there seems to be some probs with the code.
i noticed in your thread2 example that it doesnt really stop the thread. at least not on my machine. I open a test patch with thread2 object and it looks like this with 'ps afmx'
| _ pd -noadc thread.pd | _usr/local/lib/pd/bin/pd-gui | _ pd -noadc thread.pd | _ pd -noadc thread.pd
if I delete the object on the canvas or even close the patch by clicking on the "close" icon from the Window Manager (window maker), it still looks the same as above with 'ps afmx'
with readanysf~ , I am now using the ShouldExit() check in my while statement. If true, I clean up and return. Funny enough, if I delete the object from the canvas, it WILL stop the thread...or at least it goes away with 'ps afmx'. But, if I click the patch away (close it without deleting the object first) the thread seems to stay alive.
hmm - august.
You should use "ShouldExit()" in the thread function to check if the thread should terminate (and if it yields true just return from the function). See the flext tutorial example thread2 for reference.