Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: lehotsky@max.tiac.net (Alan Lehotsky)
Subject: Re: errno and DCE and threads
Date: 7 Nov 1994 20:14:22 GMT	[thread overview]
Message-ID: <39m1qu$mto@sundog.tiac.net> (raw)
In-Reply-To: 39lsjk$lrf@clam.hi.com

In article <39lsjk$lrf@clam.hi.com>, David Wright <wright@clam.hi.com> wrote:
>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
..
>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.
>
..
>  -- David Wright, Hitachi Computer Products (America), Inc.  Waltham, MA
>     wright@hi.com  ::  DCE Project Leader


	Ah, this is easy.  You remember the joke:

		Man:  	Doctor, it hurts when I do this...[wiggles arm]
		Doctor:	Don't do that!

	Well, the solution is the same for DCE and errno (also DCE and
	any other static or global data maintained outside of the DCE
	libraries).

	Don't mix thread-safe and non-threadsafe code.  You will need
	to rebuild libm and libX using appropriate header files so
	that you get the special definition of errno.

	Trying to maintain locks around this data will be a thankless
	chore.

	And while you're at it, don't forget that there's a LOT of
	libc functions that aren't thread-safe.  In fact, just about
	everything that returns a pointer is suspect [excluding the
	str functions...]

-- Al Lehotsky (former) Director Cross-Product Integration, OSF
	presently "consultant to the stars..."

======================================================================
			Quality Software Management
			      8 Tucker Ave.
			   Lexington, MA 02173

   lehotsky@tiac.net	Voice: (617)862-5418	Fax: (617)674-1096

	   Software Process Improvement and Management Consulting



  reply	other threads:[~1994-11-07 20:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-07 18:45 errno and DCE and threads David Wright
1994-11-07 20:14 ` Alan Lehotsky [this message]
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