From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,7971b9ebdbe2369 X-Google-Attributes: gidfee84,public From: "Charles M.Richmond" Subject: Re: Problem with Posix thread library Date: 1996/05/22 Message-ID: <31A3C98F.41C6@iisc.com>#1/1 X-Deja-AN: 156239745 references: <4nt7ij$jdh@news.camosun.bc.ca> <4nus8f$6l1@usenet.pa.dec.com> content-type: text/plain; charset=iso-2022-jp organization: Integrated International Systems Corp. mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0b3 (X11; I; OSF1 V3.2 alpha) Burkhard Neidecker-Lutz wrote: > > In article <4nt7ij$jdh@news.camosun.bc.ca> dbarker@camosun.bc.ca (Deryk Barker) writes: > >Has anyone had any luck getting the pthreads library to run under > >Digital Unix on an Alpha? > > Yes... > > >I have a brief test program (culled from the Sun Solaris man page > >example) which works just fine on a SPARC under Solaris 2.5 but gets a > >segmentation fault on the Alpha. > > > > You probably didn't compile it correctly. Try: > > c89 -threads threadexample.c -o threadexample > > Manually specifying the libraries is tricky and likely gives you the > wrong versions of some of the headers and libraries. For details add > a "-v" to the C compiler flags to see what it really does. > > % uname -a > OSF1 glass.kar.dec.com V3.2 41 alpha > % c89 -threads threadexample.c -o threadexample > % ./threadexample > thread 293912 sleeping 2 seconds ... > thread 291864 sleeping 4 seconds ... > thread 290840 sleeping 5 seconds ... > thread 292888 sleeping 3 seconds ... > thread 289816 sleeping 6 seconds ... > > thread 293912 awakening > > thread 291864 awakening > > thread 292888 awakening > > thread 290840 awakening > > thread 289816 awakening > main() reporting that all 5 threads have terminated > > Burkhard Neidecker-Lutz > > EUROMEDIA - Distributed Multimedia Archives for Cooperative TV Production > CEC Karlsruhe , European Applied Research Center, Digital Equip. Corp. > email: neideck@kar.dec.com > "May 96: 4xAlphaServer 8400 5/350, Unix TruCluster, Oracle: 30,390 tpmC@$305" You are absolutely correct and c89 is not necessary. The following worked for me: koibito.iisc.com> cc -threads -g -o ts ts.c koibito.iisc.com> ts thread 291864 sleeping 4 seconds ... thread 289816 sleeping 6 seconds ... thread 290840 sleeping 5 seconds ... thread 293912 sleeping 2 seconds ... thread 292888 sleeping 3 seconds ... thread 291864 awakening thread 289816 awakening thread 290840 awakening thread 293912 awakening thread 292888 awakening main() reporting that all 5 threads have terminated -- ************************************************************************* * Charles Richmond Integrated International Systems Corporation * * cmr@iisc.com cmr@koibito.iisc.com cmr@shore.net * * UNIX Internals, I18N, L10N, X, Realtime Imaging, and Custom S/W * * One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431 * * (617) 723 7695 (617) 367 3151 FAX (617) 723 6861 * *************************************************************************