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

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Sep 29 00:13:19 CEST 2006


What is also very interresting, which I thought I would share.  I
added three more Bubble Sort columns to my test app (total of 6 sort
threads - knowing bubble sort is the slowest).

I then created all 6 threads suspended (t1 thru t6 in order).  I then
resumed the threads in the order t1, t6, t2 thu t5.   They still
executed in the *creation order* ( t1 thru t6.) and not the resumed
order. Meaning t1 started and completed, t2 started and complete, etc.

Not sure if this might help the debug process...

Regards,
  - Graeme -

On 28/09/06, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> On 28/09/06, Vincent Snijders <vsnijders at quicknet.nl> wrote:
> > I know about this report:
> > http://www.freepascal.org/mantis/view.php?id=1906
> >
> > Threading related, but not the same, as you are not using synchronize,
> > are you?
> >
> > Vincent
>
> Do you mean like below - which then means, I do use synchronize.  I
> use synchronize to draw on the main form (running in the main thread).
>  I don't get any lockups as that bug report says, but then I am
> running under Ubuntu that uses Gnome desktop. Again, no such issues
> under Windows.
>
> TSortThread is the base class for my three different Sorting threads,
> so they all use this function.
>
> procedure TSortThread.VisualSwap(A, B, I, J: Integer);
> begin
>   FA := A;
>   FB := B;
>   FI := I;
>   FJ := J;
>   Synchronize(@DoVisualSwap);
> end;
>
> They never attached a sample application, so I can't try it on my
> system to see if I get the same issues as they do, but as I stated, I
> don't get lockups, only that the threads run in sequence - one after
> the other.
>
> What platform are you running on, Windows?
>
> Regards,
>   - Graeme -
>
>
> --
> There's no place like 127.0.0.1
>


-- 
There's no place like 127.0.0.1



More information about the fpc-pascal mailing list