Dont use ThreadDeathWatcher to cleanup PoolThreadCache if FastThreadL…#7445
Closed
normanmaurer wants to merge 1 commit into4.1from
Closed
Dont use ThreadDeathWatcher to cleanup PoolThreadCache if FastThreadL…#7445normanmaurer wants to merge 1 commit into4.1from
normanmaurer wants to merge 1 commit into4.1from
Conversation
614b680 to
577916c
Compare
ejona86
reviewed
Nov 27, 2017
| if (useRunnable) { | ||
| new FastThreadLocalThread(task).start(); | ||
| } else { | ||
| new FastThreadLocalThread() { |
Member
There was a problem hiding this comment.
Missing start()? Does that mean another assertion should be added to notice?
Member
Author
There was a problem hiding this comment.
yep missed and yep let me add another assertion as well
Member
Author
There was a problem hiding this comment.
Added a CountdownLatch so the test would fail with a timeout if we not start these. @ejona86 PTAL again
ejona86
approved these changes
Nov 27, 2017
…ocalThread with wrapped Runnable is used Motivation: We dont need to use the ThreadDeathWatcher if we use a FastThreadLocalThread for which we wrap the Runnable and ensure we call FastThreadLocal.removeAll() once the Runnable completes. Modifications: - Dont use a ThreadDeathWatcher if we are sure we will call FastThreadLocal.removeAll() - Add unit test. Result: Less overhead / running theads if you only allocate / deallocate from FastThreadLocalThreads.
132758b to
7e131b8
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ocalThread with wrapped Runnable is used
Motivation:
We dont need to use the ThreadDeathWatcher if we use a FastThreadLocalThread for which we wrap the Runnable and ensure we call FastThreadLocal.removeAll() once the Runnable completes.
Modifications:
Result:
Less overhead / running theads if you only allocate / deallocate from FastThreadLocalThreads.