Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!samsung!uunet!news.uu.net!microsoft!petergo From: petergo@microsoft.UUCP (Peter GOLDE) Newsgroups: comp.os.os2.programmer Subject: Re: Multi-threaded appl & printf Message-ID: <72473@microsoft.UUCP> Date: 21 May 91 05:36:58 GMT References: <1991May16.153241.11420@grasp1.univ-lyon1.fr> <1991May16.183737.5877@unixg.ubc.ca> Reply-To: petergo@microsoft.UUCP (Peter GOLDE) Organization: Microsoft Corp., Redmond WA Lines: 14 >In article <1991May16.153241.11420@grasp1.univ-lyon1.fr> wolf@grasp1.univ-lyon1.fr (Christophe Wolfhugel) writes: >>Is following correct (OS/2 1.2EE / IBM C/2 1.1): >> >>The main thread of an application creates a second thread (with >>DosCreateThread) that uses printf to display some text. The .obj >>file is linked to llibcmt & doscalls. If the C/2 libraries are like the MS-C libraries (and I think they are very close), you need to call _beginthread to start the thread rather than DosCreateThread. _beginthread initializes some per-thread static data (stuff like errno), which also includes the stack size used by the stack checking routine. Calling DosCreateThread directly will result in problems like what you are seeing.