Skip to content

Instantly share code, notes, and snippets.

@josejuan
Last active August 29, 2015 13:56
Show Gist options
  • Save josejuan/8924957 to your computer and use it in GitHub Desktop.
Save josejuan/8924957 to your computer and use it in GitHub Desktop.
static IEnumerable<int> enumerableFib(int N) {
var q = new BlockingCollection<int>();
new Thread(() => {
SyncLink.Run(s => fibonacci(s, N, n => q.Add(n)));
// recuerda que por defecto Run espera a terminar
q.CompleteAdding();
}).Start();
return q.GetConsumingEnumerable();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment