Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: capleung@is2.hk.super.net (Patrick)
Subject: Digital UNIX ver3.x Thread Problem
Date: 1997/01/08	[thread overview]
Message-ID: <MPG.d3da2df60c714829896ae@news.hk.super.net> (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



                 reply	other threads:[~1997-01-08  5:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox