1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Pass numbers along a chain of threads.
21 func link(left chan<- int, right <-chan int) {
22 // Keep the links in dedicated operating system
23 // threads, so that this program tests coordination
24 // between pthreads and not just goroutines.
25 runtime.LockOSThread()
28 stdio.Stdout.WriteString(strconv.Itoa(v) + "\n")
34 leftmost := make(chan int)
37 for i := 0; i < N; i++ {
38 left, right = right, make(chan int)
41 for i := 0; i < R; i++ {
44 stdio.Stdout.WriteString(strconv.Itoa(x) + "\n")