Subj : Re: trying to make own version of pthread_exit() To : comp.programming.threads From : steve Date : Wed Mar 23 2005 03:15 pm In article , JS wrote: >> >void mythread_exit(void *retval){ >> > void * k; >> > k = retval; >> > >> > printf("%d",k); >> > >> >} >> >> Uh, that doesn't quite do enough if you want to be like pthread_exit(). >> pthread_exit() can be called from anywhere in the execution flow and >> will stop that execution flow. > >I know this it not the whole story :-) But where can I find some help on >making this exit function work like the pthread_exit() function. I have read >the following pages, but need some more specific info on how to implement >the different parts.: You are implementing a thread system, right? You need to do whatever is necessary to make the control "evaporate" and leave behind an appropriate trail. One common way to do that is to enter the thread runtime, remove the thread from any ready lists it might be on, leave some breadcrumbs in the thread control structure that it's gone, and do a context switch. >http://www.llnl.gov/computing/tutorials/pthreads/man/pthread_exit.txt > >http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/users_16.htm > >http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_exit.html > >http://www2.yo-linux.com/cgi-bin/man.cgi?section=all&topic=pthread_exit Those are all user-level "how do I call it" guides, not details of how to implement it. Don't take this wrong: Are you sure you're up to this? -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... .