OPT: Lock-free request queueing for multi-threaded stream clients (e.g. KNL)#176
Merged
dnachbaur merged 2 commits intoBlueBrain:masterfrom Aug 4, 2017
Merged
OPT: Lock-free request queueing for multi-threaded stream clients (e.g. KNL)#176dnachbaur merged 2 commits intoBlueBrain:masterfrom
dnachbaur merged 2 commits intoBlueBrain:masterfrom
Conversation
rdumusc
reviewed
Aug 3, 2017
deflect/StreamSendWorker.cpp
Outdated
| // and fulfill the promise already to reduce load in the send thread | ||
| std::promise<bool> promise; | ||
| promise.set_value(true); | ||
| return promise.get_future(); |
There was a problem hiding this comment.
OK, not sure why though? Is it because promise.set_value(true); takes too much time on KNL?
- move "_requests.enqueue({nullptr, tasks, false});" below the comment
- return make_ready_future(true); ?
tests/cpp/ServerTests.cpp
Outdated
| unsigned int y; | ||
| }; | ||
| std::vector<Segment> segments; | ||
| for (unsigned int i = 0; i < width + segmentSize - 1; i += segmentSize) |
There was a problem hiding this comment.
Hmmm, these termination condition look complicated, I think it should be just i < width and j < height. Maybe add:
BOOST_REQUIRE_EQUAL(numSegments, std::ceil((float)width / segmentSize) * std::ceil((float)height / segmentSize));
Also, it see that it does not matter too much here, but if you had checked the size of the received frame it's height would not have been correct because (1080 % 64) != 0 (the tile of the last row are too high)
tests/cpp/ServerTests.cpp
Outdated
|
|
||
| const unsigned int byte = segmentSize * segmentSize * 4; | ||
| std::unique_ptr<uint8_t[]> pixels(new uint8_t[byte]); | ||
| ::memset(pixels.get(), 0, byte); |
There was a problem hiding this comment.
std::vector<uint8_t> pixels(bytes, 0); ?
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.
No description provided.