[fpc-pascal] threading on posix platform

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Oct 20 08:02:03 CEST 2008


On Mon, Oct 20, 2008 at 7:22 AM, Bee <bisma at brawijaya.ac.id> wrote:
> Are there any specific things that need to be concerned regarding threading
> on posix platform (linux, mac, etc)? Especially their differences with
> windows platform.

Under Linux the thread scheduler works quite different to Windows. For
example: I ported the Thread Sort demo from Delphi 7 to Lazarus, so I
could run it under Linux. Under Linux, the three sort threads run in
sequence, where as under Windows, they run in parallel.

In the end (with a few posts to the mailing list), we found out that
if a task (thread) is quick or not very CPU intensive, Linux prefers
to give them longer timeslices instead of constantly switching
threads. That was the only thing I noticed, but other than that, I use
threads (although little at the moment) in exactly the same way as I
did with Delphi and all is fine.

Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list