From: spider@Orb.Nashua.NH.US (Spider Boardman)
Subject: Re: Threads
Date: 1995/04/06 [thread overview]
Message-ID: <SPIDER.95Apr6010218@orb.Nashua.NH.US> (raw)
In-Reply-To: 3lpjq8$r07@bcarh8ab.bnr.ca
In article <3lpjq8$r07@bcarh8ab.bnr.ca> danr@bnr.ca (Dan Reynolds) writes:
Dan> To obtain thread safe code one must remove or protect references to the
Dan> following dependencies:
Dan> o REFERENCES TO GLOBAL ERRNO
Dan> The problem is that the GLOBAL ERRNO is used by many UNIX
Dan> functions, such as file I/O, sockets, semaphores, etc...,
Dan> and even the PTHREAD library.
Umm, look again. If you read through errno.h, you'll some #if's
for threaded code. It turns out that, for threaded code, errno
is a macro, and the real error number value is in a per-thread
data area. Just be sure you built your threaded code correctly.
Use something like this:
cc ${CFLAGS} -c ${SRCS} -threads
The main thing this does for .o files is add -D_REENTRANT to the
flags passed to cfe. For final linking, though:
cc ${LDFLAGS} -o $@ ${OBJS} ${LIBS} -threads
That's where the rest of the magic (to use the right libraries)
happens. It can (and will) change from release to release, so
don't fake it out.
--
Spider Boardman (at home) spider@Orb.Nashua.NH.US
The management (my cats) made me say this ...!decvax!orb!spider
next prev parent reply other threads:[~1995-04-06 4:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-04-03 4:00 Threads Dan Reynolds
1995-04-06 4:00 ` Spider Boardman [this message]
1995-04-11 4:00 ` Threads Jeffrey M. Denham
1995-04-19 4:00 ` Threads Shaheen Ali
-- strict thread matches above, loose matches on Subject: below --
1994-11-28 16:19 threads ron harter
1994-11-29 21:56 ` threads Jay R. Talbott
1994-08-03 21:05 threads Lawrence A. Palmer
1994-08-03 23:22 ` threads Matt Thomas
1994-08-04 1:05 ` threads Sinan Karasu
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