8000 Attempt to make the compiler thread-safe. by abadams · Pull Request #1055 · halide/Halide · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Attempt to make the compiler thread-safe. #1055

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

Merged
merged 3 commits into from
Mar 1, 2016
Merged

Attempt to make the compiler thread-safe. #1055

merged 3 commits into from
Mar 1, 2016

Conversation

abadams
Copy link
Member
@abadams abadams commented Feb 26, 2016

I believe these are the changes required to make the whole compiler thread-safe. Unfortunately it comes with a 5% slowdown (in compile times) due to the atomic increment/decrement in the shared pointer.

Is a thread-safe compiler worth a 5% slowdown?

@abadams
Copy link
Member Author
abadams commented Feb 26, 2016

I clawed back some of the performance with a move constructor and assignment operator to reduce the number of times we incref/decref. Now the slowdown is in the noise.

@dsharletg
Copy link
Contributor

If the slowdown is in the noise, I don't see why we shouldn't do this. The changes look good to me.

@abadams
Copy link
Member Author
abadams commented Mar 1, 2016
8000

I'm seeing a 5% compile-time slowdown again on other apps (the fft compilation). @zvookin, do you have an opinion on whether thread-safety of the compiler is worth a 5% slowdown?

We could also conditionalize it on a preprocessor define. You can turn on and off the part that hurts performance by switching RefCount between an atomic<int> and an int. We'd still need to pick a default value, so I'd rather just make the decision.

@abadams
Copy link
Member Author
abadams commented Mar 1, 2016

Per offline discussion, merging this.

abadams added a commit that referenced this pull request Mar 1, 2016
Attempt to make the compiler thread-safe.
@abadams abadams merged commit 65bbac2 into master Mar 1, 2016
@abadams abadams deleted the thread_safety branch April 20, 2017 01:37
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
0