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

Why is the UDP transport locked in the WriteTo function? #39496

Closed
YIDWang opened this issue Jun 10, 2020 · 2 comments
Closed

Why is the UDP transport locked in the WriteTo function? #39496

YIDWang opened this issue Jun 10, 2020 · 2 comments

Comments

@YIDWang
Copy link

@YIDWang YIDWang commented Jun 10, 2020

image
Udp is a bounded transport and does not need to be thread-safe.

@YIDWang
Copy link
Author

@YIDWang YIDWang commented Jun 10, 2020

Can you help me out?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 10, 2020

Please use text, not images. Images are much harder to read. Thanks.

We don't use the issue tracker for questions. If you want to ask a question, you will get better and faster answers using a forum. See https://golang.org/wiki/Questions.

We lock the FD to ensure that nothing else changes it during the write operation. UDP sockets don't need to be thread safe, but the FD structure is handling other things as well, notably the interaction with the runtime poller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.