Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faq: odd sentence in description of goroutines #7373

Closed
ianlancetaylor opened this issue Feb 20, 2014 · 3 comments
Closed

faq: odd sentence in description of goroutines #7373

ianlancetaylor opened this issue Feb 20, 2014 · 3 comments

Comments

@ianlancetaylor
Copy link
Contributor

I'm not sure what a sentence in the FAQ entry on goroutines is trying to say.  Noting it
here so that I don't forget about it.

"The result, which we call goroutines, can be very cheap: unless they spend a lot
of time in long-running system calls, they cost little more than the memory for the
stack, which is just a few kilobytes."

Why does it matter whether a goroutine spends a lot of time in a long-running system
call?  I don't see why that changes the cost one way or another.  I can see a suggestion
that making a lot of system calls can be expensive, but why "long-running system
calls?"
@robpike
Copy link
Contributor

robpike commented Feb 20, 2014

Comment 1:

The idea here was to hint that a million outstanding system calls means a million
outstanding kernel contexts held as threads. That's no longer true to the same extent
but I don't know how to explain the situation clearly in a way that does not require
constant maintenance.
Maybe weaken to:
The result, which we call goroutines, can be very cheap: they cost little more than the
memory for the stack, which is just a few kilobytes.

@btracey
Copy link
Contributor

btracey commented Feb 21, 2014

Comment 2:

I think I understand the warning now. Maybe something along the lines of
"The result, which we call goroutines, can be very cheap: they cost little more than the
memory for the stack, which is just a few kilobytes. A goroutine is much cheaper than a
system-call that creates an OS thread (unless, of course, your goroutine launches a
system call)."
Forgive me if that is not correct; I don't have detailed knowledge on the subject.

@robpike
Copy link
Contributor

robpike commented Mar 21, 2014

Comment 3:

This issue was closed by revision 287967f.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants