Subj : Re: Where to download a pthread library To : comp.programming.threads From : David Butenhof Date : Fri Apr 01 2005 04:02 pm Drazen Kacar wrote: > David Butenhof wrote: > >> David Schwartz wrote: > >>>Many platforms require more than just linking in an additional >>>library, they need compiler flags (like -D_REENTRANT) as well. The >>>standard is '-pthread' to do > >> -pthread is arguably a reasonably widespread CONVENTION, but definitely >> not worthy of the term "standard" either in a de jure or de facto sense. >> It'll work for many versions of gcc across platforms, (but not all), and >> several vendor compilers. The second most popular is probably "-mt" >> (e.g., on Solaris). > > AFAIK, -mt is just a shortcut for -D_REENTRANT and -lthread with Sun's > compiler. You still need to add -lpthread if you want to use POSIX > threads. Maybe it would work with -mt only, but that's an implementation > artifact, I think. The real point, beyond the few common examples, is that ALL of this is "implementation artifact", unless you're using a c89 or c99 command that conforms to UNIX 2001 or later. And I doubt that many people are -- even if there really ARE any fully conforming commands (which I also doubt). -- Dave Butenhof, David.Butenhof@hp.com HP Utility Pricing software, POSIX thread consultant Manageability Solutions Lab (MSL), Hewlett-Packard Company 110 Spit Brook Road, ZK2/3-Q18, Nashua, NH 03062 .