Michael Schnell wrote:
On 09/24/2013 10:58 AM, Nikolay Nikolov wrote:
When you try to create a thread, your program terminates and writes a
message that threading is not supported.
While this absolutely does make sense, one could think about alternatives.
AFAIK, (at least for some archs) there is a variant of the pthread
(="POSIX thread") library, that internally does "user-land
multithreading". IIRC, the original POSIX definition was done with
exactly this in mind and, regarding Linux, the original Linux
implementations (aka "Linux Threads") was not fully compatible with
POSIX. Only some years ago, the Linux changed it's way of Kernel-based
thread handling to the POSIX compatible "NPTL" implementation.
Thus it should be possible to link fpc projects to a user-land thread
enabled version of pthreadlib and allow for working with TThread in DOS.
The change happened at different times on different architectures. I've
definitely had to write (Lazarus) code to take this into account, since
the PID behaviour differed.
But since AIUI LinuxThreads generally attempted to use multiple
processes, getting that to work on DOS might be a problem. It would
probably be easier to start off with coroutines, and then to change them
into real threads by preemption.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus