From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,8e9b885446835ab4 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-11-07 16:06:02 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!sundog.tiac.net!max.tiac.net!lehotsky From: lehotsky@max.tiac.net (Alan Lehotsky) Newsgroups: comp.unix.osf.misc Subject: Re: errno and DCE and threads Date: 7 Nov 1994 20:14:22 GMT Organization: The Internet Access Company Message-ID: <39m1qu$mto@sundog.tiac.net> References: <39lsjk$lrf@clam.hi.com> NNTP-Posting-Host: max.tiac.net In article <39lsjk$lrf@clam.hi.com>, David Wright 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