I can only create 118 threads on Windows 7 32bit
Original Reporter info from Mantis: aurawin
-
Reporter name: Andrew Brunner
Original Reporter info from Mantis: aurawin
- Reporter name: Andrew Brunner
Description:
No matter how small I make the stack size I cannot create more than 118 threads using FPC's TThread object.
Steps to reproduce:
Create an implemented thread in Windows (32)
TMyThread.Create(NO_SUSPEND,1024)
On entering tthread.inc's Create I see my values but then tracing into BeginThread(...
Which then just calls CurrentTM.BeginThread(with my 1024)...
unit systhrd.inc SysBeginThread(sa:pointer,stacksize:ptrunit;...)
at that point my value became a pointer (assuming by ptrunit=pointer to unsigned int). So instead of reading the value, it's reading the value of the pointer and taking that as the stack size.
ti^.stklen:=stacksize;
Watching under debugger stacksize is 1896628 not 1024. But after that line is executed watch displays ti^.stklen=1024.
Mantis conversion info:
- Mantis ID: 17755
- OS: MS Windows (32bit)
- OS Build: 7
- Build: 16257 (subversion)
- Platform: Toshiba Satellite T135
- Version: 2.5.1
- Fixed in version: 3.1.1
- Fixed in revision: 33346 (#65c880a7)
- Monitored by: » BigChimp (Reinier Olislagers), » Vincent (Vincent Snijders), » @PascalDragon (Sven Barth)
- Target version: 3.0.2