Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Fork/Tcl/fork.tcl
Normal file
19
Task/Fork/Tcl/fork.tcl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package require Expect
|
||||
# or
|
||||
package require Tclx
|
||||
|
||||
for {set i 0} {$i < 100} {incr i} {
|
||||
set pid [fork]
|
||||
switch $pid {
|
||||
-1 {
|
||||
puts "Fork attempt #$i failed."
|
||||
}
|
||||
0 {
|
||||
puts "I am child process #$i."
|
||||
exit
|
||||
}
|
||||
default {
|
||||
puts "The parent just spawned child process #$i."
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue