Hi, all.
Can anybody explain why first call of thread::create makes 2 system threads instead of one?
For example, we have t.tcl script:
~$ cat t.tcl
#!/usr/bin/tclsh
package require Thread
puts "stage1"
after 10000
thread::create {thread::wait}
puts "stage2"
after 10000
thread::create {thread::wait}
puts "stage3"
after 10000
We run it. And check system threads on every stage change:
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
8134 8372 pts/2 00:00:00 t.tcl
8134 8373 pts/2 00:00:00 t.tcl
~$ ps -aL | grep t.tcl
8134 8134 pts/2 00:00:00 t.tcl
8134 8372 pts/2 00:00:00 t.tcl
8134 8373 pts/2 00:00:00 t.tcl
8134 8605 pts/2 00:00:00 t.tcl
Hi Oleg,
what is your platform? If it is linux, which threadding system was
compiled in (pthreads) (found by the configure script).
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 916 |
Nodes: | 10 (1 / 9) |
Uptime: | 50:01:03 |
Calls: | 12,172 |
Calls today: | 2 |
Files: | 186,522 |
Messages: | 2,234,694 |