Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-10

Threads

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Davidson

Would it be possible to add a property to TThreads to expose DefaultStackSize in rtl/inc/threadh.inc
Or something similar.

Working on app that uses lots of complex recursion. Ran into problems and ended rewriting this component. In order to meet stack size limit, program runs much slower.

Comments please?

P Davidson
Corax Networks Inc.
http://CoraxNetworks.com

IMPORTANT NOTICE: This message is intended only for the use of the individual or entity to which it is addressed. The message may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify Corax Networks immediately by email at Thank you.

Reply by email

Michael Van Canneyt
to Paul Davidson
Paul Davidson wrote
Would it be possible to add a property to TThreads to expose DefaultStackSize in rtl/inc/threadh.inc Or something similar.

It should be possible, yes, however this will require that the stack size is added to the constructor: the constructor calls beginthread.

But we'll need also to change the BeginThread call itself, because it will need the stacksize as an (optional) parameter.

This can (and probably should) be done, but that will not make it in the

Show quoted text 6 lines
Working on app that uses lots of complex recursion. Ran into problems and ended rewriting this component. In order to meet stack size limit, program runs much slower. Comments please?

For the time being, the easiest is to set the thread manager to your own thread manager, and set the stack yourself in the BeginThread function. However, this will create all threads with the same size.

Michael.

Reply by email

Paul Davidson
to Michael Van Canneyt
Michael Van Canneyt wrote 10 lines
On Fri, 28 Oct 2005, Paul Davidson wrote: > Would it be possible to add a property to TThreads to expose > DefaultStackSize in rtl/inc/threadh.inc > Or something similar. It should be possible, yes, however this will require that the stack size is added to the constructor: the constructor calls beginthread.

This makes sense. Much as other thread properties are usually done in constructor as well.

Show quoted text 18 lines
But we'll need also to change the BeginThread call itself, because it will need the stacksize as an (optional) parameter. This can (and probably should) be done, but that will not make it in the > > Working on app that uses lots of complex recursion. Ran into > problems and ended rewriting this component. In order to meet stack > size limit, program runs much slower. > > Comments please? For the time being, the easiest is to set the thread manager to your own thread manager, and set the stack yourself in the BeginThread function. However, this will create all threads with the same size.

In this case it is acceptable

Show quoted text 7 lines
Michael. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

P Davidson
Corax Networks Inc.
http://CoraxNetworks.com

Reply by email