Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!atha!aunro!ersys!bking From: ersys!bking@nro.cs.athabascau.ca (Barry King) Newsgroups: comp.os.os2.programmer Subject: Re: OS/2 C compiler Keywords: OS/2 'C' Message-ID: <73wR12w164w@ersys.uucp> Date: 21 Apr 91 21:48:17 GMT References: <1991Apr20.190744.6675@unixg.ubc.ca> Organization: Edmonton Remote Systems, Edmonton, AB, Canada Lines: 40 ballard@cheddar.ucs.ubc.ca (Alan Ballard) writes: > In article <1581@integow.uucp> hot@integow.uucp (Roland van Hout) writes: > > > >We are UNIX C programmers. We have the possibility to port some of our > >applications to OS/2 for a client. Is it possible to compile reentrant > >C programs to save memory or must we implement threads to simulate > >this capability. > 1) All OS/2 code is reentrant. If you are run more than one copy of the > program, only one copy of the code is loaded. > 2) If you want to share code among different applications, you create > "dynamic link libraries" containing the code. > 3) Even if you did need to use threads, you don't need to implement them. > OS/2 has built-in threads. > OS/2 does all this stuff much better than unix. > Whoa. When you say that all OS/2 code is reentrant, that may be true for the operating system, but this is _definitely_ not true for applications programs. Hence the requirement for reentrant libraries like MSC LLIBCMT.LIB and the deficiency in Zortech's C++ compiler that does not support reentrant code. Running more than one copy of the program is one thing but the code within a given running program is not gauranteed to be reentrant unless you code it as such. Same with DLLs - they'll have to be coded to be reentrant with appropriate libraries. OS/2 of course has 'built in' threads - each process is at least one thread under the PM. Within an application, it is the programmer who determines what runs under separate threads. I'm sure you know this, Allan, but for the benefit of the poster of the message to which you replied, I think some clarification is necessary. I found your reply somewhat misleading. Regards! Barry King ersys!bking@nro.cs.athabascau.ca Edmonton Remote Systems: Serving Northern Alberta since 1982