Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
3
Task/Concurrent-computing/Tcl/concurrent-computing-1.tcl
Normal file
3
Task/Concurrent-computing/Tcl/concurrent-computing-1.tcl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
after [expr int(1000*rand())] {puts "Enjoy"}
|
||||
after [expr int(1000*rand())] {puts "Rosetta"}
|
||||
after [expr int(1000*rand())] {puts "Code"}
|
||||
3
Task/Concurrent-computing/Tcl/concurrent-computing-2.tcl
Normal file
3
Task/Concurrent-computing/Tcl/concurrent-computing-2.tcl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
after idle {puts "Enjoy"}
|
||||
after idle {puts "Rosetta"}
|
||||
after idle {puts "Code"}
|
||||
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