* Digital UNIX ver3.x Thread Problem
@ 1997-01-08 5:00 Patrick
0 siblings, 0 replies; only message in thread
From: Patrick @ 1997-01-08 5:00 UTC (permalink / raw)
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<phread.h>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-01-08 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-01-08 5:00 Digital UNIX ver3.x Thread Problem Patrick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox