Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Thread support    [ Add a report in this area ]  
Report #:  77203   Status: Open
Allow thread stack size to be specified when creating the thread
Project:  Delphi Build #:  11.0.2902.10471
Version:    11.2 Submitted By:   Luigi Sandon
Report Type:  New Feature Request Date Reported:  8/31/2009 4:06:23 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   272999
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
4.00 out of 5
Total Votes: 86
Description
In Delphi 2007 TThread.Create specifies the standard thread stack size passing 0 for the dwStackSize parameter.

  FHandle := BeginThread(nil, 0, @ThreadProc, Pointer(Self), CREATE_SUSPENDED, FThreadID);

An overloaded constructor that could set per-thread stack size would be welcome.
Steps to Reproduce:
See description.
Workarounds
None
Attachment
None
Comments

Lucian Radulescu at 8/31/2009 7:10:22 PM -
ditto

+10

Erik van Bilsen at 1/21/2011 9:57:08 AM -
As concurrent programming (and increased number of threads) is getting more and more important, customizing a threads stack size becomes a necessity.

+10

Stuart Seath at 8/14/2016 1:10:10 PM -
PLEASE PLEASE fix this extremely serious bug.  In applications which require a large stack size for their main thread (in our case due to legacy code making extensive use of recursive procedures) it is extremely serious that every single thread must also have large stack.  I can (laboriously) fix this for my own threads, but with more and more code (Parallel Library for example) using standard TThread code, the existing code is insupportable.

We really would also like some sort of global default stack size for threads other than the main thread (obviously separate from the windows one stored in the executable).

Server Response from: ETNACODE01