Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: "Charles M.Richmond" <cmr@iisc.com>
Subject: Re: Problem with Posix thread library
Date: 1996/05/22	[thread overview]
Message-ID: <31A3C98F.41C6@iisc.com> (raw)
In-Reply-To: 4nus8f$6l1@usenet.pa.dec.com


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.
> 
>         <code deleted>
> 
> 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       *
 *************************************************************************



  reply	other threads:[~1996-05-22  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-21  4:00 Problem with Posix thread library Deryk Barker
1996-05-22  4:00 ` Burkhard Neidecker-Lutz
1996-05-22  4:00   ` Charles M.Richmond [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-05-22  4:00 problem with posix " sean levy
1996-05-23  4:00 ` Burkhard Neidecker-Lutz
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