-
Notifications
You must be signed in to change notification settings - Fork 124
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
very basic work-stealing #629
Conversation
408655d
to
961a29e
Compare
961a29e
to
586c167
Compare
stack_size = DEFAULT_STACK_SIZE; | ||
if (unlikely((uint64_t)reserved_space > stack_size / 2)) | ||
LOG_ERROR_RETURN(EINVAL, nullptr, VALUE(reserved_space), "must be <= half of ", VALUE(stack_size)); | ||
uint64_t FLAGS = THREAD_JOINABLE | THREAD_ENABLE_WORK_STEALING; |
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.
FLAGS
looks like just a simple const value, should be defined as const or constexpr.
@@ -1884,7 +2018,11 @@ R"( | |||
return _n_vcpu.load(std::memory_order_relaxed); | |||
} | |||
|
|||
int vcpu_init() { | |||
int vcpu_init(uint64_t flags) { | |||
uint64_t FLAGS = VCPU_ENABLE_ACTIVE_WORK_STEALING | |
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.
const/constexpr
@@ -61,8 +65,10 @@ namespace photon | |||
const uint64_t DEFAULT_STACK_SIZE = 8 * 1024 * 1024; | |||
// Thread stack size should be at least 16KB. The thread struct located at stack bottom, | |||
// and the mprotect page is located at stack top-end. | |||
// reserved_space must be <= stack_size / 2 | |||
thread* thread_create(thread_entry start, void* arg, |
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.
thread_create now able to set THREAD_ENALBE_WORK_STEALING when creating, but still need methods to enable/disable stealing for thread temporary.
4b830be
to
6e073bd
Compare
6e073bd
to
e07b13d
Compare
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.
LGTM
No description provided.