CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
13
Task/Concurrent-computing/Tcl/concurrent-computing-3.tcl
Normal file
13
Task/Concurrent-computing/Tcl/concurrent-computing-3.tcl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package require Thread
|
||||
set pool [tpool::create -initcmd {
|
||||
proc delayPrint msg {
|
||||
after [expr int(1000*rand())]
|
||||
puts $msg
|
||||
}
|
||||
}]
|
||||
tpool::post -detached $pool [list delayPrint "Enjoy"]
|
||||
tpool::post -detached $pool [list delayPrint "Rosetta"]
|
||||
tpool::post -detached $pool [list delayPrint "Code"]
|
||||
tpool::release $pool
|
||||
after 1200 ;# Give threads time to do their work
|
||||
exit
|
||||
Loading…
Add table
Add a link
Reference in a new issue