Prioritizing goroutine in golang

Issue

I’m writing a low latency network, high throughput server in golang. It has acceptor in the main goroutine (which accepts incoming connections). And it passes the incoming connections to ‘n’ number of worker goroutines.

In this case, to not drop connections, I want the acceptor goroutine to be prioritized over other goroutines so that connections won’t be dropped. Or atleast this acceptor goroutine should not get evicted by other worker goroutines.

How can I ensure this?

Solution

I have created threadpools on golang. This should allow easily one to prioritize certain goroutines over others.

https://github.com/vijayviji/executor

Answered By – viji

Answer Checked By – David Marino (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.