Too many threads created on Windows for stdio channels
Closed / Fixed21280817d1c5bc6f65972a4050d51f79d2ba470cCreated 4 years agoUpdated 4 years ago
Descriptionwiki2022-06-27 15:36:42
Originally reported by Steve Shaw (HammerDB) based on a query from Microsoft when load testing SQLServer. Running 900+ threads for TPC-C benchmarks, they were observing several times that number of threads in tclsh but not in wish.
The reason turned out to be that tclsh (on Windows only) creates three *additional* threads for stdin, stdout and stderr for each Tcl thread created. This is true even if the additional threads do not actually do operations on stdio. Obviously this is wasteful in terms of system resources but also performance since each Tcl thread creation actually spawns 4 threads. wish does not have any console channels and thus does not exhibit this issue.
Referenced by2
2e1c732755New ticket [baa51423c2] tclWinConsole: needEvent variable is used uninitialized. ticket2022-08-20 07:04:13c085b9090cNew Windows console driver. Fixes [21280817d1] thread proliferation and [44bbccdd8c] fconfigure std{out,err}. check-in2022-07-10 14:06:35
apnadkarniplain2022-06-29 13:11:52
The win-console branch contains a proposed new implementation for 8.7.
apnadkarniplain2022-07-10 14:24:09
Fixed with [c085b9090c] in core-8-branch
Log in (anonymous is fine) to add a comment.