From 893126b10bea887f9a0b046580837411a06cde4a Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Sat, 23 Mar 2024 13:41:35 +0100 Subject: [PATCH] the case of a leaky goroutine: fix paragraph nl --- content/post/2024/03/the-case-of-a-leaky-goroutine.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/post/2024/03/the-case-of-a-leaky-goroutine.md b/content/post/2024/03/the-case-of-a-leaky-goroutine.md index 72e12407..54828103 100644 --- a/content/post/2024/03/the-case-of-a-leaky-goroutine.md +++ b/content/post/2024/03/the-case-of-a-leaky-goroutine.md @@ -7,7 +7,7 @@ tags: - go --- -In the programming language Go, it's _very_ easy to program something using high-level concurrent patterns thanks to the concept of _Goroutines_ and channels used to signal between them. A Goroutine is essentially a coroutine that maps onto green threads that map onto real native threads on your OS in an `NxM` way. The simple `go func()` prepend-style syntax makes fire-and-forget Goroutines for executing small tasks in parallel trivial. +In the programming language Go, it's _very_ easy to build something using high-level concurrent patterns thanks to the concept of _Goroutines_ and channels used to signal between them. A Goroutine is essentially a coroutine that maps onto green threads that map onto real native threads on your OS in an `NxM` way. The simple `go func()` prepend-style syntax makes fire-and-forget Goroutines for executing small tasks in parallel trivial. Or is it? If we are to believe Katherine Cox-Buday, the author of O'Reilly's [Concurrency In Go](https://katherine.cox-buday.com/concurrency-in-go/), it's not: @@ -35,8 +35,6 @@ Once you managed to get your profile dump, you can analyze it with `go tool ppro Let's get back to that context that's never truly cancelled. This piece of code is the perpetrator: -enkel een context. In plaats van verder te werken op die context door middel van context.WithCancel(...) gebruikten wij de volgende func om die omvorming te doen: - ```go func ToDoneInterface(done <-chan struct{}) <-chan interface{} {