Article View: comp.os.os2.programmer
Article #2919Re: OS/2 libraries thread-safe ?
From: Bruce Kitchin
Date: Thu, 17 Dec 1992 21:30
Date: Thu, 17 Dec 1992 21:30
21 lines
1574 bytes
1574 bytes
Ernst Kloecker (ernst@opal.cs.tu-berlin.de) wrote: The C library has been pretty well handled by the other responses. If you compile properly with IBM C Set/2 (set the multithreaded compile option) you should be completely safe except from your own multithreaded errors (simultaneous access of shared globals without semaphore protection). : Or are the only safe functions the OS-functions in 'bsedos.h' ? : : Or are even those functions not completely thread-safe ? : All functions declared through including os2.h (includes bse*.h, pm*.h, etc) are safe. They are part of or attached to the operating system which is designed for such problems. They are not part of the C library. Again, you can get into trouble due to sharing your own variables. But I believe that every Dos, Win, Gpi, Mou, Kbd, Vio, etc call is atomic to the extent that anything that it depends on in the system (such as file buffers) are modified without the chance of another thread getting in. However, two DosWrite's in a row may be split by a DosWRite from another thread.
Technical Details
Message-ID:
<1gqrhuINNh4u@hpscit.sc.hp.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!sdd.hp.com!hpscit.sc.hp.com!kitchinReferences:
<1992Dec16.221352.26031@cs.tu-berlin.de>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!sdd.hp.com!hpscit.sc.hp.com!kitchin From: kitchin@lf.hp.com (Bruce Kitchin) Newsgroups: comp.os.os2.programmer Subject: Re: OS/2 libraries thread-safe ? Date: 17 Dec 1992 21:30:38 GMT Organization: Hewlett Packard Santa Clara Site Lines: 22 Message-ID: <1gqrhuINNh4u@hpscit.sc.hp.com> References: <1992Dec16.221352.26031@cs.tu-berlin.de> NNTP-Posting-Host: eden.avo.hp.com X-Newsreader: TIN [version 1.1.2 PL7]