From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,4753a27d8ceddc44 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-02-18 14:05:16 PST Newsgroups: comp.unix.osf.misc Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!scsing.switch.ch!news.univie.ac.at!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!sdd.hp.com!ncr-sd!ncrcae!ncrhub2!ncrgw2!psinntp!ibism!gjb From: gjb@fig.citib.com (Greg Brail) Subject: Re: Thread-safe libraries for C++? Message-ID: Sender: news@fig.citib.com Organization: Citibank IBISM References: <1993Feb12.204022.25188@nntpd.lkg.dec.com> <1993Feb16.175330.11699@mdivax1.uucp> Date: Thu, 18 Feb 1993 22:05:16 GMT In article <1993Feb16.175330.11699@mdivax1.uucp> robinson@mdd.comm.mot.com (Jim Robinson) writes: >Michael J. Grier (mjg@ktbush.ogo.dec.com) wrote: >> (I'm not directly involved with DCE, but I've been using pthreads and >>DEC's CMA thread programming interface for a few years, so I might be able >>to help...) > >> It means that there is liberal use of #define to change your invocation >>of standard library functions to instead call the DCE jacket, which is >>a function which will perform the work behind your back to ensure that the >>operation is carried out in a thread-safe manner. > >Is it correct to say then that if one forgets to #include the relevant >header the result is that the native select() is used which could block >the entire process instead of just the calling thread? Is so, isn't this >an incredibly easy mistake to make which may not be terribly easy to >catch? Most DCE implementations I've seen actually put thread-safe versions of system calls and standard library functions in a library that gets linked in with DCE. Thus, you get the "proper" versions of these functions even if you deliberately turn off the #defines (which is sometimes necessary). Yes, all this #defining and re-defining is a mess, and I hope it gets easier when more vendors offer user-accessible threads in the OS. Right now, all this is one reason why the toughest thing about DCE programming is writing the makefile. greg -- Greg Brail ------------------ Citibank -------------------- gjb@fig.citib.com lose (lOOz) v. 1. a. To be unable to find; mislay. b. To incur the deprivation of, as by negligence or accident. 2. To be unable to maintain, sustain, or keep. 3. The most commonly misspelled word on Usenet.