Re:Memory usage of a toy C# server and client with 500K conc...
by WoodenChair on Saturday January 26, 2019 @07:22PM
(#19009499)
Goroutines are not threads:
https://rcoh.me/posts/why-you-can-have-a-million-go-routines...
[ Parent
| on HN ]
Re:Memory usage of a toy C# server and client with 500K conc...
by giancarlostoro on Saturday January 26, 2019 @07:56PM
(#19009659)
Goroutines are probably closer to Fibers which D also has:
Re:Memory usage of a toy C# server and client with 500K conc...
by zzzcpan on Saturday January 26, 2019 @08:15PM
(#19009770)
They used to be closer to fibers years ago, when they were running on a single thread by default. Now they behave exactly like normal threads with the same problems. And fibers are threads anyway.
Re:Memory usage of a toy C# server and client with 500K conc...
by giancarlostoro on Saturday January 26, 2019 @10:11PM
(#19010151)
Care to share a reference to them no longer being lightweight?
Re:Memory usage of a toy C# server and client with 500K conc...
by zzzcpan on Sunday January 27, 2019 @01:11PM
(#19012893)
They still start with tiny stacks, if that's what you are asking. I believe it's somewhere around 2 KB nowadays.
Re:Memory usage of a toy C# server and client with 500K conc...
by hu3 on Sunday January 27, 2019 @06:37AM
(#19011341)
goroutines are anything but threads.
Here's a 40min talk explaining how Go's scheduler works:
Re:Memory usage of a toy C# server and client with 500K conc...
by zzzcpan on Sunday January 27, 2019 @01:05PM
(#19012860)
No, they are threads. It doesn't matter if they start with tiny growing stacks and whether blocking syscall wrappers call into the scheduler. Those are just implementation details.
Re:Memory usage of a toy C# server and client with 500K conc...
by Groxx on Tuesday January 29, 2019 @07:01PM
(#19031204)
I mean, sure, but they have all the same problems as threads for most / application-level developers. They're indeed quite different when you get into calling out to C or other kinds of FFI, but relatively few developers need to do so directly. For everyone else, they come with very nearly exactly the same semantics as threads.