[fpc-pascal] Threads executing in sequence instead of parallel

Micha Nelissen micha at neli.hopto.org
Fri Sep 29 18:55:18 CEST 2006


Graeme Geldenhuys wrote:
> We have a problem!!!
> 
> The test project /fcl/tests/threads.pp as well as a Sort Demo (Bubble,
> Section and Quick Sort) all execute the threads in sequence, waiting
> for the previous thread to complete, before the next one executes.
> Kind of defeats the point of using threads.

There is no bug. The time slice management is simply different. Try
attached demo (it's your demo modified). You will notice that output
will be mixed.

Linux simply gives longer timeslices to threads (for efficiency reasons).

Micha
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demo1.pp
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20060929/a1402532/attachment.ksh>


More information about the fpc-pascal mailing list