Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/Concurrent-computing/Go/concurrent-computing-3.go
Normal file
25
Task/Concurrent-computing/Go/concurrent-computing-3.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
w1 := make(chan bool, 1)
|
||||
w2 := make(chan bool, 1)
|
||||
w3 := make(chan bool, 1)
|
||||
for i := 0; i < 3; i++ {
|
||||
w1 <- true
|
||||
w2 <- true
|
||||
w3 <- true
|
||||
fmt.Println()
|
||||
for i := 0; i < 3; i++ {
|
||||
select {
|
||||
case <-w1:
|
||||
fmt.Println("Enjoy")
|
||||
case <-w2:
|
||||
fmt.Println("Rosetta")
|
||||
case <-w3:
|
||||
fmt.Println("Code")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue