RFR: Invoke implDeregister() at wakeup()

Miao Zheng duke at openjdk.java.net
Thu Apr 21 13:41:49 UTC 2022


On Mon, 4 Apr 2022 12:58:29 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> A virtual thread may park itself and register an event of EPoll when it invoke an operation of NioSocket. If the Inputstream or NioSocket closed, the call stack is like:
>> 
>> Poller::wakeup
>> Poller::stopPoll
>> NioSocketImpl.close()
>> ···
>> 
>> 
>> I have a question that do we need invoke implDeregister() before unpark virtual thread?
>
> Just to ACK that I've seen the PR. I am curious if you are seeing an issue or not. It shouldn't be necessary to explicitly deregister and I need a bit of time to page in some of the details to see if there are any side effects (async close mostly).

@AlanBateman Thanks for your review. If we do not explicit deregister will result epoll monitor a closed fd. Because a closed fd can be reused, I have not construct a case that the number of fd monitor by epoll overflow.

-------------

PR: https://git.openjdk.java.net/loom/pull/128


More information about the loom-dev mailing list