Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!tut!hydra!hylka!kulokari From: kulokari@cc.helsinki.fi Newsgroups: comp.os.os2 Subject: Re: Problem with multiple threads ... Message-ID: <1714.25ab2970@cc.helsinki.fi> Date: 10 Jan 90 12:24:16 GMT References: <1028@tuminfo1.lan.informatik.tu-muenchen.dbp.de> <3460@csccat.UUCP> <10198@microsoft.UUCP> Distribution: comp.os.os2 Organization: University of Helsinki Lines: 23 In article <10198@microsoft.UUCP>, leefi@microsoft.UUCP (Lee Fisher) writes: > [regarding the discussion of _beginthread() being unnecessary] > > Yes, if you use the MS C 5.1 runtime functions inside a newly created > thread, you should be using _beginthread() to create it. If you're > using "pure" OS/2 APIs inside this thread (and no C RTL functions), you > can use DosCreateThread(). The _beginthread() function sets up things in > the C runtime so it can run properly. Also, on page 26 of the MSC 5.1 Update of the MSC User's guide there is a list of functions in the *standard* run-time library, which *are* re-entrant and thus *can* be used even in multi-threaded programs. With proper care, you can do just about anything with these functions. I stand by my earlier statement that using the special multi-threaded library should be avoided at any cost. The cost is not so high if you limit your use of multiple threads to special cases, and use OS/2 API functions when necessary instead of the C runtime library (for I/O at least). The concept of threads is non-portable anyway. Hannu Kulokari CC, U of Helsinki kulokari@cc.helsinki.fi (Internet) kulokari@finuh (Bitnet)