KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q47932: C 5.10 Multi-Thread Library or DLL Limited to 32 Threads

Article: Q47932
Product(s): See article
Version(s): 5.10
Operating System(s): OS/2
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 16-JAN-1990

The C 5.10 statically linked, multi-thread library LLIBCMT.LIB and
the dynamically linked, multi-thread CRTLIB.DLL only support a single
process's threads numbered 1 to 32 inclusive. This limits an
application that uses C run-time functions to creating 31 threads with
the _beginthread() function, in addition to the process's initial
thread 1.

If you call C run-time library (or DLL) functions from thread 33 or
higher, no error message will be issued, but you will get undefined
results including incorrect data and segment violations. Note that
creating threads that call C run-time library functions should be done
with the _beginthread() function to perform required C-library
initializations that are not performed by DosCreateThread().

Since the thread maximum number 32 limit is per process, calling
another DLL does not increase the number of supported threads since
the instance of the DLL called by the process is effectively part of
the process. Spawning or exec'ing a child process allows the new
process a new set of threads 1-32.

A substantially greater number of threads will be considered for
inclusion in a future release.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.