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 // Compute Fibonacci numbers with two goroutines
8 // that pass integers back and forth. No actual
9 // concurrency, just threads and synchronization
10 // and foreign code on multiple pthreads.
21 func fibber(c, out chan int64, i int64) {
22 // Keep the fibbers in dedicated operating system
23 // threads, so that this program tests coordination
24 // between pthreads and not just goroutines.
25 runtime.LockOSThread()
32 stdio.Stdout.WriteString(strconv.FormatInt(j, 10) + "\n")
42 out := make(chan int64)
46 for i := 0; i < 90; i++ {