On Wed, 13 Oct 2010, Andrew Brunner wrote:
On Tue, Oct 12, 2010 at 5:51 PM, Andrew Brunner <andrew.t.brun...@gmail.com> wrote: Another problem demonstrated with this application is the limiting factor of thread creation. I'd like to make a complaint using this code as well. Change the number of threads to 3000. The system gets to about 1,000 and starts to "bog down". I have a significantly fast computer here and I can tell that thread creation is not supposed to be this slow. Under delphi 2006 (windows) I was able to create up to 3000 threads. I recall stories of other programs in Java running well past that 3000. Why does fpc handle threads in a way that causes creation to slow down the more you have (as they approach 1,000) things slow to a stall.
Probably because it uses a heap manager per thread. You may try to use 'cmem', which will replace the heap manager with the C memory manager (one for the whole app, not per thread). That will allow you to test this hypothesis. Michael. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal