[fpc-pascal] Threads

Michael Van Canneyt michael at freepascal.org
Fri Oct 28 15:12:01 CEST 2005



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.

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.

Michael.



More information about the fpc-pascal mailing list