-
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
[Wisp] Thread-based asynchronous IO implementation #57
Conversation
52056ad
to
e32db8c
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.
Looks good to me.
@@ -486,7 +517,17 @@ public int skipBytes(int n) throws IOException { | |||
* @exception IOException if an I/O error occurs. | |||
*/ | |||
public void write(int b) throws IOException { | |||
write0(b); | |||
if (WispAsyncIO.useAsyncIO()) { | |||
sun.misc.SharedSecrets.getWispAsyncIOAccess().executeAsyncIO(new Callable<Integer>() { |
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.
Maybe we can remove the sun.misc.
? Will look more ordered.
Runtime.getRuntime().availableProcessors()); | ||
MAX_POOL_SIZE = parsePositiveIntegerParameter(p, "com.alibaba.aio.maxPoolSize", | ||
Runtime.getRuntime().availableProcessors()); | ||
AIO_QUEUE_LIMIT = parsePositiveIntegerParameter(p, "com.alibaba.aio.queueLimit", -1); |
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.
I wonder about the magic number. I think we'd better use a named variable to represent the -1
and reference it here. Or if the -1
changes afterwards, we may get to change several places all together.
MAX_POOL_SIZE = parsePositiveIntegerParameter(p, "com.alibaba.aio.maxPoolSize", | ||
Runtime.getRuntime().availableProcessors()); | ||
AIO_QUEUE_LIMIT = parsePositiveIntegerParameter(p, "com.alibaba.aio.queueLimit", -1); | ||
TIMEOUT = parsePositiveIntegerParameter(p, "com.alibaba.aio.timeout", -1); |
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.
also this, and all hard coded -1
places
348b7b9
to
9e2e0b1
Compare
Summary: Use ThreadPool as asynchronous IO delegate for asynchronous IO implementation. The feature can be used in Wisp flow and non-Wisp flow. Test Plan: test/com/alibaba/wisp/io/ThreadPoolAIOTest.java Reviewed-by: leiyu, zhengxiaolinX Issue: dragonwell-project/dragonwell8#213 thread local judge
Not necessay now |
Summary:
Use ThreadPool as asynchronous IO delegate for asynchronous IO implementation.
The feature can be used in Wisp flow and non-Wisp flow.
Test Plan: test/com/alibaba/wisp/io/ThreadPoolAIOTest.java
Reviewed-by: leiyu, zhengxiaolinX
Issue: dragonwell-project/dragonwell8#213