Common wisdom seems to be that MS-DOS was an exclusively single-threaded OS. Of course, implementing a scheduler would be possible, but the OS itself did not provide any facilities for multithreading, at least to my knowledge.
For this reason, I was surprised while perusing the manual for the v5.1 MS C compiler:
7.2.2 Re-entrant Functions
The existing run-time library is designed primarily for single-thread execution. Most of the functions are not re-entrant, and therefore cannot be executed by more than one thread at a time. The functions below are re-entrant and therefore may be used in multi-thread programs:
The table below contains a list of functions and the minor changes made to them.
Minor Changes to Functions
Function Change exit, _exit Terminates all threads of the calling program.
This seems to imply that there was at least some common framework for multithreading considered in the design of MS-DOS. I guess making (some of) the functions re-entrant is just a matter of ensuring they are not accessing any shared data, but the library would need to be aware of the threads in order to terminate them, wouldn't it? The documentation does not reference DOS 4.0 (multitasking), but instead it says it's targetting DOS 3.x (and OS/2):
Welcome to the Microsoft® C Optimizing Compiler Version 5.1 Update. This update discusses new features of the C language, in particular the ability to program within OS/2 systems. The pages that follow use the term “OS/2” to refer to both Microsoft Operating System/2 (MS® OS/2) and IBM® OS/2. Similarly, the term “DOS” is used to refer to both MS-DOS® and IBM Personal Computer DOS.
Here are the major new features of Version 5.1:
- OS/2 support. Version 5.1 includes new libraries, language features, and enhanced development tools that allow you to write programs for OS/2 protected mode as well as the DOS 3.x (OS/2 real-mode) environment.
So my question is, did the regular (non-multitasking) DOS have any multithreaded facilities, or not?