* threads
@ 1994-11-28 16:19 ron harter
1994-11-29 21:56 ` threads Jay R. Talbott
0 siblings, 1 reply; 9+ messages in thread
From: ron harter @ 1994-11-28 16:19 UTC (permalink / raw)
Sometime last spring I saw a posting explaining how to map the pthread calls
to the equivalent calls on a sun box running solaris. Could someone please
forward me a copy of that article.
Thanks
--
+--------------------------------------+--------------------------------------+
| Ron Harter | Tongue tied and twisted |
| Network Management Technology Inc. | Just an earth bound misfit .. I |
| harter@nmti.com | David Gilmour |
+--------------------------------------+--------------------------------------+
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: threads
1994-11-28 16:19 threads ron harter
@ 1994-11-29 21:56 ` Jay R. Talbott
0 siblings, 0 replies; 9+ messages in thread
From: Jay R. Talbott @ 1994-11-29 21:56 UTC (permalink / raw)
In article <id.F04F1._MB@nmti.com> harter@nmti.com writes:
>
>
>Sometime last spring I saw a posting explaining how to map the pthread calls
>to the equivalent calls on a sun box running solaris. Could someone please
>forward me a copy of that article.
>
>Thanks
>
>--
>+--------------------------------------+--------------------------------------+
>| Ron Harter | Tongue tied and twisted |
>| Network Management Technology Inc. | Just an earth bound misfit .. I |
>| harter@nmti.com | David Gilmour |
>+--------------------------------------+--------------------------------------+
Please pipe me a copy too!
Thanks,
Jay
--
----------------------------------------------------------------------
| Jay Talbott | Verbex Voice Systems | (508) 486-8886 x429 |
| Software Engineer | 119 Russell St. | (508) 486-9654 FAX |
| | Littleton, MA 01460 | jtalbott@rad.verbex.com |
^ permalink raw reply [flat|nested] 9+ messages in thread
* Threads
@ 1995-04-03 4:00 Dan Reynolds
1995-04-06 4:00 ` Threads Spider Boardman
1995-04-11 4:00 ` Threads Jeffrey M. Denham
0 siblings, 2 replies; 9+ messages in thread
From: Dan Reynolds @ 1995-04-03 4:00 UTC (permalink / raw)
Since we are blessed by so many DEC employees in our newsgroup, I have a
question regarding DEC threads and the use of thread safe code.
To obtain thread safe code one must remove or protect references to the
following dependencies:
o Static (or global) read-write data
o File descriptors shared between threads
o REFERENCES TO GLOBAL ERRNO
o calls to other nonthread-safe routines.
The problem is that the GLOBAL ERRNO is used by many UNIX functions, such as
file I/O, sockets, semaphores, etc..., and even the PTHREAD library.
So, my question is, how can one write thread safe code, when a significant
number of UNIX functions are using the GLOBAL ERRNO, which includes the PTHREAD
library?
thanks...
Dan
--
Dan Reynolds | (613)-763-7584 | Opinions expressed are my own and do
Bell-Northern Research | | not necessarily reflect my employer.
Ottawa, Ontario, Canada | danr@bnr.ca |
-------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Threads
1995-04-03 4:00 Threads Dan Reynolds
@ 1995-04-06 4:00 ` Spider Boardman
1995-04-11 4:00 ` Threads Jeffrey M. Denham
1 sibling, 0 replies; 9+ messages in thread
From: Spider Boardman @ 1995-04-06 4:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Threads
1995-04-03 4:00 Threads Dan Reynolds
1995-04-06 4:00 ` Threads Spider Boardman
@ 1995-04-11 4:00 ` Jeffrey M. Denham
1995-04-19 4:00 ` Threads Shaheen Ali
1 sibling, 1 reply; 9+ messages in thread
From: Jeffrey M. Denham @ 1995-04-11 4:00 UTC (permalink / raw)
In article <3lpjq8$r07@bcarh8ab.bnr.ca>, danr@bnr.ca (Dan Reynolds) writes:
|>Since we are blessed by so many DEC employees in our newsgroup, I have a
|>question regarding DEC threads and the use of thread safe code.
|>
|>To obtain thread safe code one must remove or protect references to the
|>following dependencies:
|>
|> o Static (or global) read-write data
|> o File descriptors shared between threads
|> o REFERENCES TO GLOBAL ERRNO
|> o calls to other nonthread-safe routines.
|>
|>
|>The problem is that the GLOBAL ERRNO is used by many UNIX functions, such as
|>file I/O, sockets, semaphores, etc..., and even the PTHREAD library.
|>
|>So, my question is, how can one write thread safe code, when a significant
|>number of UNIX functions are using the GLOBAL ERRNO, which includes the PTHREAD
|>library?
|>
|>thanks...
|>
|>Dan
|>
|>--
|>Dan Reynolds | (613)-763-7584 | Opinions expressed are my own and do
|>Bell-Northern Research | | not necessarily reflect my employer.
|>Ottawa, Ontario, Canada | danr@bnr.ca |
|>-------------------------------------------------------------------------------
|>
Here's a reply from a DECthreads developer who hasn't had time to monitor the
newsgroup lately:
That's simply untrue! DECthreads and libc_r do write the global "int errno"
when they report an error, but that's strictly secondary and only for
compatibility with code that's not built using _REENTRANT. They ALSO set a
per-thread errno, and that's what all code should be reading when using
thread-safe libraries.
DECthreads provides _errno(), which returns the address of a per-thread errno
cell. And (when the _REENTRANT or _THREADSAFE flag is defined) errno.h #defines
errno to call _errno() and dereference it. The result is "virtually
indistinguishable" from a global errno, but it's completely thread safe with
no synchronization.
Including cma.h or pthread.h automatically defines _REENTRANT, so as long as
errno.h is included after one of those you get it for free. If you don't
include one of those headers, or if you include errno.h first, you'll get the
global errno.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Threads
1995-04-11 4:00 ` Threads Jeffrey M. Denham
@ 1995-04-19 4:00 ` Shaheen Ali
0 siblings, 0 replies; 9+ messages in thread
From: Shaheen Ali @ 1995-04-19 4:00 UTC (permalink / raw)
"Jeffrey" == Jeffrey M Denham <denham@denham.zk3.dec.com> writes:
In article <1995Apr11.170345.14566@decvax.dec.com> denham@denham.zk3.dec.com (Jeffrey M. Denham) writes:
[...Alot of stuff I deleted. Basically, Dan Reynolds wants to know
what to do about two different errno's in a library or a binary...]
Jeffrey> Here's a reply from a DECthreads developer who hasn't had
Jeffrey> time to monitor the newsgroup lately:
Jeffrey> That's simply untrue! DECthreads and libc_r do write the
Jeffrey> global "int errno" when they report an error, but that's
Jeffrey> strictly secondary and only for compatibility with code
Jeffrey> that's not built using _REENTRANT. They ALSO set a per-thread
Jeffrey> errno, and that's what all code should be reading when using
Jeffrey> thread-safe libraries.
While everything that this engineer writes is true there is an
underlying assumption that ALL libraries linked against a thread
consuming application are thread safe. Notice, that MT programs
should not link against libc.a, but rather against libc_r.a.
This is absolutely necessary. All libraries, .o's, shared libraries
and all binaries (crt0.o and mcrt0.o) should be libsafe if the program
is multithreaded. Not following this guideline puts the program at risk
of fetching the wrong errno.
In the simple case of linking foo.c to the proper thread library
should be handled by the compiler. Sometimes, the compiler cannot do
this. In this case, the user should guard his makefiles against
including non-threadsafe, non-reentrant libraries.
If you link a multithreaded program against libX or libXt, I am pretty
sure that these will pass errno in the thread-deadly global variable.
The results are sure to be crazy. DEC may be kind enough to provide
thread-safe versions of these libraries. In that case, be sure that
your multithreaded program is using them.
Shaheen
--
--
"They're gone, buddy. But, look at the bright side: They're GONE, buddy!"
-- The Cat, _Red Dwarf_
Shaheen H. Ali, Hitachi Computer Products, Waltham, MA
ali@hi.com, [ space left blank due to unsolicited advice ]
work phone: (617) 890 0444, fax: (617) 890 4998
PGP fingerprint = 9C B1 FB F2 A5 62 64 C1 CB 6A E6 3A 86 B0 A4 B7
^ permalink raw reply [flat|nested] 9+ messages in thread
* threads
@ 1994-08-03 21:05 Lawrence A. Palmer
1994-08-03 23:22 ` threads Matt Thomas
0 siblings, 1 reply; 9+ messages in thread
From: Lawrence A. Palmer @ 1994-08-03 21:05 UTC (permalink / raw)
Pleas excuse my ignorance about OSF1. Does it provide any support for
threads, or an equivalent to the Sun Lightweight Process Library?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: threads
1994-08-03 21:05 threads Lawrence A. Palmer
@ 1994-08-03 23:22 ` Matt Thomas
1994-08-04 1:05 ` threads Sinan Karasu
0 siblings, 1 reply; 9+ messages in thread
From: Matt Thomas @ 1994-08-03 23:22 UTC (permalink / raw)
In article <Ctz98E.B4y@proteon.com>, lxp@proteon.com (Lawrence A. Palmer) writes:
|>Pleas excuse my ignorance about OSF1. Does it provide any support for
|>threads, or an equivalent to the Sun Lightweight Process Library?
DEC OSF/1 provides a pthread (POSIX threads) compatible library.
--
Matt Thomas Internet: thomas@lkg.dec.com
U*X Networking WWW URL: http://ftp.dec.com/%7Ethomas/
Digital Equipment Corporation Disclaimer: This message reflects my
Littleton, MA own warped views, etc.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: threads
1994-08-03 23:22 ` threads Matt Thomas
@ 1994-08-04 1:05 ` Sinan Karasu
0 siblings, 0 replies; 9+ messages in thread
From: Sinan Karasu @ 1994-08-04 1:05 UTC (permalink / raw)
In article <31p8rc$14i@nntpd.lkg.dec.com>,
Matt Thomas <thomas@lkg.dec.com> wrote:
>
>In article <Ctz98E.B4y@proteon.com>, lxp@proteon.com (Lawrence A. Palmer) writes:
>|>Pleas excuse my ignorance about OSF1. Does it provide any support for
>|>threads, or an equivalent to the Sun Lightweight Process Library?
>
>DEC OSF/1 provides a pthread (POSIX threads) compatible library.
Are they kernel based? Can they be scheduled asynchronously outside
of the scheduler time-base generateor interrupt?
Thanx...
>--
>Matt Thomas Internet: thomas@lkg.dec.com
>U*X Networking WWW URL: http://ftp.dec.com/%7Ethomas/
>Digital Equipment Corporation Disclaimer: This message reflects my
>Littleton, MA own warped views, etc.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~1995-04-19 4:00 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-11-28 16:19 threads ron harter
1994-11-29 21:56 ` threads Jay R. Talbott
-- strict thread matches above, loose matches on Subject: below --
1995-04-03 4:00 Threads Dan Reynolds
1995-04-06 4:00 ` Threads Spider Boardman
1995-04-11 4:00 ` Threads Jeffrey M. Denham
1995-04-19 4:00 ` Threads Shaheen Ali
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox