From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,611580bbad096c19,start X-Google-Attributes: gidfc89c,public X-Google-Thread: 10d532,611580bbad096c19,start X-Google-Attributes: gid10d532,public X-Google-Thread: fee84,611580bbad096c19,start X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,611580bbad096c19,start X-Google-Attributes: gidf678f,public X-Google-Thread: ffc1e,611580bbad096c19,start X-Google-Attributes: gidffc1e,public From: capleung@is2.hk.super.net (Patrick) Subject: Digital UNIX ver3.x Thread Problem Date: 1997/01/08 Message-ID: #1/1 X-Deja-AN: 208610876 organization: Hong Kong Technical College newsgroups: comp.programming.threads,comp.unix.osf,comp.unix.osf.misc,comp.unix.osf.osf1,comp.unix.programmer My school is using a digial unix on a dec alpha. I have some problems on using it. I am currently using the POSIX thread to implement a program. A sample program I run is under : ===================================================================== #include pthread_t MyThread; void* init_thread(int i) { printf("I am thread number %d\n",i); sleep(3); printf("I am thread number %d, I have wakeup\n",i); pthread_exit(NULL); } void main() { printf("Trying the DecThread\n"); pthread_create(&MyThread,pthread_attr_default,init_thread,1); pthread_exit(NULL); } ======================================================================= I then compile the program using %cc -w TestThread.c -threads And sucessfully compiled But When I ran, an exception ran out, I test it , and found out is when the main() have reached the pthread_exit(), the whole program terminats instead of waiting for all the threads terminats. Help Please Thx in advance!!!!!!!!!!!!!!!!!!!!! Patrick Leung capleung@hk.super.net Hong Kong Techinical College