Jonathan Eustace
Jonathan Eustace

Reputation: 2489

How can I manually create threads in Go?

I'm aware that goroutines are the way to deal with concurrency in Go, however I'm running a test in which I will be comparing a regular multithreaded server vs a server using level triggered epoll vs edge triggered epoll. I can figure out how to create the epoll ones, however I've searched hi and low on how to create threads manually to no avail.

Upvotes: 8

Views: 12906

Answers (2)

Volker
Volker

Reputation: 42413

You cannot do that. In Go you cannot control this kind of stuff.

Upvotes: 7

Martin Gallagher
Martin Gallagher

Reputation: 4814

You might be able to bind a goroutine to a CPU thread: http://play.golang.org/p/mNPCyvpN2R (run locally on a multi CPU/core machine).

Upvotes: 5

Related Questions