-
Couldn't load subscription status.
- Fork 207
Don't call getenv in side threads
#984
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
Conversation
getenv on side threadsgetenv in side threads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genius PR!
|
@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@eqy has updated the pull request. You must reimport the pull request before landing. |
|
@eqy has updated the pull request. You must reimport the pull request before landing. |
|
@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@eqy has updated the pull request. You must reimport the pull request before landing. |
|
@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
@eqy has updated the pull request. You must reimport the pull request before landing. |
|
@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@eqy has updated the pull request. You must reimport the pull request before landing. |
|
@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Calling
getenvon side threads is dangerous as it can potentially segfault if the main thread is in the middle of setting environment variables: pytorch/pytorch#134596This PR only calls
getenvonly once during the first call ofisDaemonEnvVarSet(), which is called frominit.Co-authored-by: Nikita Shulga [email protected]