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-12 10:43:45 PST Xref: sparky comp.lang.c++:21059 comp.unix.osf.misc:106 Newsgroups: comp.lang.c++,comp.unix.osf.misc Path: sparky!uunet!newsgate.watson.ibm.com!news.ans.net!howland.reston.ans.net!usc!sdd.hp.com!decwrl!pacbell.com!att-out!walter!bbq!doel From: doel@bbq.uucp (Mike Doel) Subject: Thread-safe libraries for C++? Message-ID: <1993Feb12.184345.19220@walter.bellcore.com> Sender: news@walter.bellcore.com Nntp-Posting-Host: bbq.bae.bellcore.com Organization: Bell Communications Research Date: Fri, 12 Feb 93 18:43:45 GMT 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?). My question is, has anything been done to make C++ libraries safe? If not, can we still develop C++ applications in a DCE threaded environment? I talked to someone at Transarc (who has a DCE implementation for SunOS 4.1.2) and he suggested we do something like this: //obtain the "mutex", however that's done cout << "Now it's safe to do output" //release the mutex This strikes me as terribly kludgy. Obtaining and release the mutex should be done by the stream class, not the user of it. Does anyone have any experience they can offer? Thanks -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Mike Doel