-
Notifications
You must be signed in to change notification settings - Fork 8
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
Linux: Removing threadpool_open and threadpool_close along with SM states #416
base: master
Are you sure you want to change the base?
Conversation
/azp run #Resolved |
Azure Pipelines successfully started running 1 pipeline(s). #Resolved |
Removed. In reply to: 2512829554 Refers to: linux/src/threadpool_linux.c:32 in a679d72. [](commit_id = a679d72, deletion_comment = False) |
No pipelines are associated with this pull request. |
wake_by_address_single(threadpool->task_array[current_index].pending_work_item_count_ptr); | ||
/* Codes_SRS_THREADPOOL_LINUX_05_046: [ threadpool_work_func shall release the shared SRW lock by calling srw_lock_release_exclusive. ]*/ | ||
(void)interlocked_decrement(threadpool->task_array[current_index].pending_work_item_count_ptr); | ||
wake_by_address_single(threadpool->task_array[current_index].pending_work_item_count_ptr); |
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.
Since you're only waiting up if the value is zero, then you need to have an if on the decrement as to only wait on zero, it makes it more efficient.
if (interlocked_decrement(...) == 0)
{
wake_by_address_single(...);
}
|
||
srw_lock_release_exclusive(threadpool_ptr->srw_lock); | ||
wake_by_address_single(task_item->pending_work_item_count_ptr); |
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.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Removing Threadpool Open and Close and SM states.