Jump to content

Using Threads

From EDM2
Revision as of 04:19, 4 November 2007 by Myrkraverk (talk | contribs) (Initial attempt at explaining threads and synchronization API)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Rationale

After reading the Pthreads Primer, and attmepting to apply it to eCS, I found a need for an introduction to the API and explanations on how to use it. This is an attempt to fill that void. --Myrkraverk 03:19, 4 November 2007 (CET)

Creating Threads

There are two basic ways to create threads using the OS/2 API, DosCreateThread() and _beginthread(). However, note the following from the OpenWatcom C/C++ Programmers Guide:

WARNING! If any thread calls a library function, you must use the _beginthread function to create the thread. Do not use the DosCreateThread API function.