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

Make global scope not thread-safe #4850

Merged
merged 4 commits into from
Oct 17, 2017

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Oct 16, 2017

  1. It is no need to make global scope thread-safe, since it will be
    invoked in Python main thread.
  2. Do not free the global scope when C++ exit. Let the OS free memories,
    otherwise, we need to handle the destroy dependencies.

See
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

1. It is no need to make global scope thread-safe, since it will be
invoked in Python main thread.
2. Do not free the global scope when C++ exit. Let the OS free memories,
otherwise, we need to handle the destroy dependencies.

See
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
@reyoung reyoung requested a review from QiJune October 16, 2017 23:33
QiJune
QiJune previously approved these changes Oct 16, 2017
Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

wangkuiyi
wangkuiyi previously approved these changes Oct 17, 2017
Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following the code style and good practice!

Copy link
Member

@QiJune QiJune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@reyoung reyoung merged commit 064c369 into PaddlePaddle:develop Oct 17, 2017
@reyoung reyoung deleted the feature/fix_global_scope branch October 17, 2017 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants