-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Ataymano/queue size control #1663
Ataymano/queue size control #1663
Conversation
@@ -29,6 +30,7 @@ namespace reinforcement_learning { | |||
if (!_queue.empty()) | |||
{ | |||
*item = std::move(_queue.front()); | |||
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size())); |
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.
#include
@@ -29,6 +30,7 @@ namespace reinforcement_learning { | |||
if (!_queue.empty()) | |||
{ | |||
*item = std::move(_queue.front()); | |||
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size())); |
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.
Use static_cast instead of c style casts
@@ -29,6 +30,7 @@ namespace reinforcement_learning { | |||
if (!_queue.empty()) | |||
{ | |||
*item = std::move(_queue.front()); | |||
_capacity = (std::max)((int)0, (int)_capacity - (int)(item->size())); |
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.
Why is the function name surrounded by parentheses?
|
||
private: | ||
//thread-unsafe | ||
typename queue_t::iterator erase(typename queue_t::iterator it) { |
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.
create an alias for iterator_t to avoid having to use typename in the function signature
The reinforcement_learning directory has moved to its own repo. Can you please reopen this PR there? https://github.com/VowpalWabbit/reinforcement_learning |
Superseded by VowpalWabbit/reinforcement_learning#15 |
Sampling based on queue capacity