[fpc-devel] Light weight threads for FPC

Michael Schnell mschnell at lumino.de
Fri Dec 14 11:44:45 CET 2007


> No, TThread is either heavy or middle-weight, according to the 
> definitions at
>
> http://whatis.techtarget.com/definition/0,,sid9_gci814910,00.html
>   
Of course it would be possible to include a multitasking scheduler in 
the RTL to avoid any system calls and share any resources. (AFAIK, for 
Linux there somewhere was an alternate PThread library that does exactly 
in order to avoid slight Posix incompatibilities caused by "Linux 
Threads". But same is not necessary any more as the OS-based NPTL is 
said to perform just as good and Posix-compatible.)

I.e. if using Linux with NPTL (or that old special PThread library), I 
don't see how you could use "lighter" threads than with TThread.

If using Windows, (with it's quite heavy native Threads), pure user mode 
threads might be a lot "lighter". I do suppose that there are (C based) 
libraries that could be used here.

Anyway, the target for "lighter" threads is not really TThread itself, 
but the underlying scheduler.

-Michael




More information about the fpc-devel mailing list