Threads

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Threads

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
[hidden email].  Thank you.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Threads

Michael Van Canneyt


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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Threads

Paul Davidson

On Oct 28, 2005, at 9:12, Michael Van Canneyt wrote:

>
>
> 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.

>
> 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

>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
P Davidson
Corax Networks Inc.
http://CoraxNetworks.com

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal