Recent

Author Topic: Threadpool engine version 1.5  (Read 9720 times)

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: Threadpool engine version 1.5
« Reply #15 on: June 24, 2013, 10:55:40 pm »

Hello,

So as you have noticed there is MPMC FIFO queues
that are not scalable, and there is others that
are fully scalable(the one that uses elemination
for example) , and there is others MPMC FIFO queues
that are partially scalable, scalable only when every
consumers are pushing, as my Threadpool engine with
the exec() method that you can use as a partially
scalable MPMC FIFO queue, those  partially scalable MPMC FIFO
queues are useful also i think.

You can download my Threadpool engine version 1.51 from:

http://pages.videotron.com/aminer/

Thank you,
Amine Moulay Ramdane.


 

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: Threadpool engine version 1.5
« Reply #16 on: June 25, 2013, 12:22:02 am »

Hello,

I have been working with Delphi 7 and FreePascal, and
i have discovered a bug in the TThread class in both of them,
the TThread class of Delphi 7 and FreePascal and Lazarus
is not working correctly and it causes a deadlock when used
with the WaitFor() method.

I have compiled my Threadpool that uses the TThread class
with Delphi XE4 and the TThread class is working correcly
under Delphi XE4, but there is still a problem with the Delphi XE4,
the memory manager of Delphi XE4 is not scalable.


So, I must change my Threadpool engine to avoid this TThread
bug that causes a deadlock, i will do it next time.


My code is not buggy, but the freepascal and Delphi 7
compilers are buggy.




Thank you,
Amine Moulay Ramdane.



aminer

  • Hero Member
  • *****
  • Posts: 956
Re: Threadpool engine version 1.5
« Reply #17 on: June 25, 2013, 01:41:47 am »

Hello,

I have updated Threadpool to version 1.52, now it avoids
the bug, and now it is running perfectly.

You can Threadpool version 1.52 from:


http://pages.videotron.com/aminer/


Thank you,
Amine Moulay Ramdane.


aminer

  • Hero Member
  • *****
  • Posts: 956
Re: Threadpool engine version 1.5
« Reply #18 on: June 26, 2013, 03:44:03 am »

Hello,

Sorry i have told you that my Threadpool used as a FIFO queue
is partially scalable, but in fact it's fully scalable, when only
one thread is pushing it can not be scalable, but when many
producers are pushing and many consumers are poping it's scalable,
so it's fully scalable.


Run the test1.pas example that i have included inside
my Threadpool zip file, and you will see that my Threadpool
used as a FIFO queue is fully scalable.

You can use the same idea for stacks, so you will have also a
fully scalable stack.

I will update my Threadpool engine with priorities and you will
have also a priority FIFO queue that is fully scalable.
 

You can download my Threadpool engine version 1.52 from:

http://pages.videotron.com/aminer/



Thank you,
Amine Moulay Ramdane.



JD

  • Hero Member
  • *****
  • Posts: 1908
Re: Threadpool engine version 1.5
« Reply #19 on: June 26, 2013, 10:02:44 am »
I have been working with Delphi 7 and FreePascal, and
i have discovered a bug in the TThread class in both of them,
the TThread class of Delphi 7 and FreePascal and Lazarus
is not working correctly and it causes a deadlock when used
with the WaitFor() method.

I have compiled my Threadpool that uses the TThread class
with Delphi XE4 and the TThread class is working correcly
under Delphi XE4, but there is still a problem with the Delphi XE4,
the memory manager of Delphi XE4 is not scalable.


So, I must change my Threadpool engine to avoid this TThread
bug that causes a deadlock, i will do it next time.


My code is not buggy, but the freepascal and Delphi 7
compilers are buggy.




Thank you,
Amine Moulay Ramdane.

Why don't you put this in the bug tracker http://bugs.freepascal.org/my_view_page.php so that it can be fixed for the long run because not everybody may know how to write a workaround for the bug you found?

JD
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

aminer

  • Hero Member
  • *****
  • Posts: 956
Re: Threadpool engine version 1.5
« Reply #20 on: June 26, 2013, 02:32:05 pm »

JD wrote:
>Why don't you put this in the bug tracker >http://bugs.freepascal.org
>my_view_page.php so that it can be fixed >for the long run because not everybody >may know how to write a workaround for >the bug you found?


The bug was not with the TThread class, it was when i was freeing the queues objects and other objects inside a for loop that the bug showed, when i have freed some of the objects outside the for loop all was ok...



Thank you,
Amine Moulay Ramdane.

 

TinyPortal © 2005-2018