Многопоточность
GoStmt = "go" [ "(" GoArgs ")" ] Block
GoArgs = identifier ":" Expression { "," identifier ":" Expression }func myThread {
for i in 0..50 {
Print(`x` )
if i % 3 == 0 : sleep(5)
}
}
run {
thread th = go {
for i in 0..100 {
Print(` `, i )
if i % 7 == 0 : sleep(5)
}
}
suspend( th )
go : myThread()
resume(th)
Print( `OK`)
wait(th)
Print( `END`)
}Last updated
Was this helpful?