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.
8 // Compute Fibonacci numbers with two goroutines
9 // that pass integers back and forth. No actual
10 // concurrency, just threads and synchronization
11 // and foreign code on multiple pthreads.
20 func fibber(c
chan *big
.Int
, out
chan string, n
int64) {
21 // Keep the fibbers in dedicated operating system
22 // threads, so that this program tests coordination
23 // between pthreads and not just goroutines.
24 runtime
.LockOSThread()
39 c
:= make(chan *big
.Int
)
40 out
:= make(chan string)
43 for i
:= 0; i
< 200; i
++ {