Reply to post: Re: Yes, its you.

Google's Grumpy code makes Python Go

smartypants

Re: Yes, its you.

"They don't actually give you any more power."

Well in principle perhaps, but context switching is expensive. go distributes goroutines across a small number of pthreads (e.g. one per core), and *it* rather than the os decides how optimally to switch between goroutines. You can write an app with huge numbers of goroutines without worrying that the platform has been tuned for the large number of threads, or worrying about the impact of the os thrashing between threads when perhaps it can be avoided. That's a win. And as goroutines are lightweight, and channels between goroutines are built into the language, it makes it easy to use parallelism to implement 'map-reduce' type algorithms, even with hundreds of thousands of concurrent 'threads'. Tuning and efficiency aside, writing go concurrent code is idiotically easy.

This page describes the design choices made:

https://dave.cheney.net/2015/08/08/performance-without-the-event-loop

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon