Top "Goroutine" questions

A goroutine is a lightweight thread of execution that is managed by the Go language runtime.

Wait for the termination of n goroutines

I need to start a huge amount of goroutines and wait for their termination. The intuitive way seems to use …

concurrency go channel coroutine goroutine
Best way to use HTTP client in a concurrent application

First I'll describe my case. I have to do HTTPS requests to several APIs from my application and they should …

http go concurrency goroutine
How does select work when multiple channels are involved?

I found when using select on multiple non buffered channels like select { case <- chana: case <- chanb: } …

select go scheduling channel goroutine
How to wait until buffered channel (semaphore) is empty?

I have a slice of integers, which are manipulated concurrently: ints := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} I'm using a buffered channel as semaphore in …

go semaphore channel goroutine
How does goroutines behave on a multi-core processor

I am a newbie in Go language, so please excuse me if my question is very basic. I have written …

parallel-processing go goroutine
Is it safe for more than one goroutine to print to stdout?

I have multiple goroutines in my program, each of which makes calls to fmt.Println without any explicit synchronization. Is …

concurrency synchronization go goroutine
OK to exit program with active goroutine?

Take the following code snippet: func main() { ch := make(chan int) quit := make(chan int) go func() { for { ch <…

go goroutine
Why Golang cannot generate json from struct with front lowercase character?

I am trying to print json result from struct I created as following: type Machine struct { m_ip string m_…

go goroutine
Does Go have something like ThreadLocal from Java?

I use Go and Gin to setup my website and want to know the database access time. I use goroutine …

go goroutine thread-local-storage
What's the best practices to run a background task along with server listening

I'm new to Go. Say I have a server listening to HTTP request, and at the same time I need …

go goroutine