Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-08-20
07:04 • New ticket [baa51423c2] tclWinConsole: needEvent variable is used uninitialized<... artifact: 2e1c732755 user: fvogel
2022-07-10
14:24 • Closed ticket [21280817d1]: Too many threads created on Windows for stdio channe... artifact: d8602d9816 user: apnadkarni
14:06
New Windows console driver. Fixes [21280817d1] thread proliferation and [44bbccdd8c] fconfigure std{... check-in: c085b9090c user: apnadkarni tags: core-8-branch
2022-06-29
13:11 • Ticket [21280817d1] Too many threads created on Windows for stdio channels s... artifact: df5226e232 user: apnadkarni
2022-06-27
15:36 • New ticket [21280817d1]. artifact: 3b2643ef41 user: apnadkarni

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