Threading challenge: calculate fib(45) while spinning

jfondren julian.fondren at gmail.com
Fri Oct 15 04:17:01 UTC 2021


On Friday, 15 October 2021 at 03:54:17 UTC, Ali Çehreli wrote:
> On 10/14/21 8:35 PM, jfondren wrote:
>> The book, "The Go Programming Language" has this simple 
>> goroutine example:
>
> Here is one that uses receiveTimeout and OwnerTerminated:
>

Very nice, replacing Thread.sleep with receiveTimeout and getting 
graceful interruption for free. This also doesn't crash.


More information about the Digitalmars-d-learn mailing list