Skip to content
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

[Wisp] use global coroutine list instead of the coroutine list in eac… #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joeyleeeeeee97
Copy link
Contributor

…h thread

Summary:
Currently, we need to add a lock when we steal a coroutine.
If the lock can't be got, the stealing failed.
Use global coroutine list to avoid the moving in coroutine list.
When we steal the coroutine, we only set the thread in the coroutine.
With the change, the success rate has been greatly increased.

Test Plan: all wisp cases

Reviewed-by: lei.yul, zhengxiaolinX

Issue: dragonwell-project/dragonwell8#227

@CLAassistant
Copy link

CLAassistant commented Apr 20, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…h thread

Summary:
Currently, we need to add a lock when we steal a coroutine.
If the lock can't be got, the stealing failed.
Use global coroutine list to avoid the moving in coroutine list.
When we steal the coroutine, we only set the thread in the coroutine.
With the change, the success rate has been greatly increased.

Test Plan: all wisp cases

Reviewed-by: lei.yul, zhengxiaolinX

Issue: dragonwell-project/dragonwell8#227
Copy link
Contributor

@zhengxiaolinX zhengxiaolinX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can we check about the correctness when co-work with the Parallel Scavenge collector, as we discussed?

return c->wisp_thread();
}
}
ALL_JAVA_COROUTINES(c) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I may wonder: around the code we only check about the Threads_lock, and the _coroutine_list_lock is only used at coroutine insertion and deletion conditions. Do we need it when traversing the global list? Please check about here and other places of ALL_JAVA_COROUTINES. If we are traversing the list while some coroutines are inserting in, it may get things broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants