[fpc-devel] Multithreading under DOS

Leif Ekblad leif at rdos.net
Thu Sep 26 19:29:34 CEST 2013


The problem with multitasking under DOS is that the DOS int 21h call will 
switch stacks before doing anything useful. That means you cannot multitask 
DOS calls in the same virtual machine (unless you provide a fully emulated 
DOS environment as my RDOS OS did some 10 years ago). BIOS is less 
problematic, but also has static data that wasn't designed for multitasking. 
So you need to put a big lock on DOS and BIOS calls, and you cannot use APIs 
that block (because that will block everything).

Leif



----- Original Message ----- 
From: "Bernd Oppolzer" <bernd.oppolzer at t-online.de>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Thursday, September 26, 2013 11:40 AM
Subject: Re: [fpc-devel] Multithreading under DOS


> Am 26.09.2013 11:07, schrieb Tomas Hajny:
>>> Here the old style ("light weight" / "internal" multi-thread enabled)
>>> pthread lib might help. Supposedly same does not need to be "installed"
>>> but could be statically linked to.
>> You can run another operating system on top of DOS (that's basically what
>> DOS extenders did), but you still need to find the solution first (and 
>> the
>> solution is not the "POSIX threads library", but the "extender").
>>
>> Tomas
>>
> I believe that DOS from its design is so limited that the only
> solution is what OS/2 did: isolate every DOS session and
> give it an own - single threaded - copy of a virtual machine,
> where DOS can run the old DOS applications.
>
> The POSIX threads should be moved to or implemented on
> "real" operating systems.
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel 




More information about the fpc-devel mailing list