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.
19 func fibber(c chan *big.Int, out chan string, n int64) {
20 // Keep the fibbers in dedicated operating system
21 // threads, so that this program tests coordination
22 // between pthreads and not just goroutines.
23 runtime.LockOSThread()
38 c := make(chan *big.Int)
39 out := make(chan string)
42 for i := 0; i < 200; i++ {