Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: wright@clam.hi.com (David Wright)
Subject: errno and DCE and threads
Date: 7 Nov 1994 13:45:08 -0500	[thread overview]
Message-ID: <39lsjk$lrf@clam.hi.com> (raw)

We're running into some real problems with productizing DCE when it
comes to dealing with other, non-DCE, libraries.  (This is on an OSF/1
base, BTW.)

The single biggest problem is errno handling.  Errno is a single,
global variable in standard Unix.  (Granted, this was a really bad
design decision, but we're stuck with it.)  Since DCE applications are
multi-threaded, they need to be able to keep errno on a per-thread
basis (so they don't trip over each other's values).

Within DCE itself, this is not a big deal.  You can redefine errno to
be a function that points to a per-thread data item.  The problem
arises when you try to link against other libraries (libX, let's say,
or libm) that still use the global variable.

Actually, there are two problems.  One is that multiple threads might
try to call a non-thread-safe function that sets errno.  This you can
presumably handle within your application by doing your own locking.
The other problem lies in communicating errno values between threaded
and non-threaded code.

We've come up with some possible solutions for this problem, but
before we do anything rash, we wondered if anyone out there could tell
us what other vendors have done.

  -- David Wright, Hitachi Computer Products (America), Inc.  Waltham, MA
     wright@hi.com  ::  DCE Project Leader


             reply	other threads:[~1994-11-07 18:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-07 18:45 David Wright [this message]
1994-11-07 20:14 ` errno and DCE and threads Alan Lehotsky
1994-11-08 15:42 ` Andrew Hastings
1994-11-08 21:35   ` Simon Patience
1994-11-09 20:05     ` Andrew Hastings
1994-11-09 13:27 ` Rich Salz
1994-11-15 10:14   ` Casper H.S. Dik
1994-11-15 16:38     ` Rich Salz
1994-11-15 21:19       ` Casper H.S. Dik
1994-11-15 21:40       ` Alan Lehotsky
1994-11-15 22:09     ` Spike White
1994-11-17 17:09       ` Alan Deehr
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