-
Notifications
You must be signed in to change notification settings - Fork 37
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
[Misc] Resource Management API #8
Conversation
return ROOT; | ||
} | ||
|
||
public static AbstractResourceContainer current() { |
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.
current() == null
looks like undefined behavior, we'd better return non-null value, either ROOT or current
if (!VM.isBooted()) {
return root();
}
return JLA.getResourceContainer(Thread.currentThread());
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.
👍
It's a good idea to ensure that Thread.resourceContainer is always not null. 😋
* with {@link ResourceContainer#current()} | ||
*/ | ||
protected void detach() { | ||
JLA.setResourceContainer(Thread.currentThread(), null); |
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.
JLA.setResourceContainer(Thread.currentThread(), root())
Summary: Introduce ResourceContainer to manage resources. ResourceContainer defines a set of resource Constraint that limit resource usage by threads. Test Plan: jtreg com/alibaba/rcm Reviewed-by: luchsh, sanhong Issue: dragonwell-project/dragonwell8#87
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.
looks good
Summary:
Introduce ResourceContainer to manage resources.
ResourceContainer defines a set of resource Constraint
that limit resource usage by threads.
Test Plan: jtreg com/alibaba/rcm
Reviewed-by: luchsh sanhong
Issue: dragonwell-project/dragonwell8#87