From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,4753a27d8ceddc44 X-Google-Attributes: gid109fba,public X-Google-Thread: f678f,4753a27d8ceddc44 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-02-16 09:54:19 PST Xref: sparky comp.lang.c++:21172 comp.unix.osf.misc:113 Path: sparky!uunet!caen!destroyer!cs.ubc.ca!utcsri!robinson Newsgroups: comp.lang.c++,comp.unix.osf.misc From: robinson@mdivax1.uucp (Jim Robinson) Subject: Re: Thread-safe libraries for C++? Message-ID: <1993Feb16.175330.11699@mdivax1.uucp> Followup-To: comp.unix.osf.misc Reply-To: robinson@mdd.comm.mot.com (Jim Robinson) Organization: Motorola - Mobile Data Division; Richmond, BC X-Newsreader: TIN [version 1.1 PL8] References: <1993Feb12.204022.25188@nntpd.lkg.dec.com> Date: 16 Feb 93 17:54:19 GMT Michael J. Grier (mjg@ktbush.ogo.dec.com) wrote: >In article <1993Feb12.184345.19220@walter.bellcore.com>, doel@bbq.uucp (Mike Doel) writes: >|> >|>Our group is doing a little research into which implementation of RPC's we >|>wish to use for an upcomming project. We're leaning towards the DCE >|>standard but for one small thing. As I understand it, the RPC mechanism for >|>DCE is implemented using DCE threads. In order to use threads, you must use >|>"thread safe" libraries. Apparently, the standard C libraries aren't thread >|>safe. To counteract this, "jacket" routines have been developed which make >|>the standard Unix libraries thread safe (what does that mean?). > (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. [and] > For some operations, the jackets go farther to give you some semblance of >thread-synchronous operation, for example select(). Your mileage will >vary depending on your UNIX variant and how serious its kernel is about not >blocking when non-blocking I/O is requested. 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? And, are the jacket routines also used to map blocking I/O calls (e.g. read(), recvfrom()) to non-blocking versions? [Followup to comp.unix.osf.misc only] -- Jim Robinson robinson@mdd.comm.mot.com {ubc-cs!van-bc,uunet}!mdivax1!robinson