Code review request 7132889: Possible race conditions in AbstractSelectableChannel
Shirish Kuncolienkar
shirishk at linux.vnet.ibm.com
Wed Aug 8 05:40:37 PDT 2012
On 8/8/2012 4:00 PM, Alan Bateman wrote:
> On 07/08/2012 14:17, Shirish Kuncolienkar wrote:
>>
>> I looked at the fix for 6346658 and that will fix the looping issue
>> as reported. However I feel that there are still issues with regLock
>> vs. keyLock as you pointed out that the synchronization is
>> inconsistent. So I suggest that you look at the change set once you
>> have some free time.
>> -Shirish
>>
> I think that expanding the scope of regLock in the register and
> configureBlocking methods is right. Changing implCloseChannel requires
> a bit of consideration and I will try to look at it next week. I
> expect that the proposed specification change will not be necessary
> and that it will be solely an implementation change to synchronize on
> regLock to avoid the case that someone registers a channel and gets a
> valid SelectionKey at around the time that the channel is closed.
>
> -Alan.
>
I agree that the specification change is not necessary. The change in
implCloseChannel could be limited to eliminating the possibility of
getting a valid selection key while the channel is being closed.
-Shirish
More information about the nio-dev
mailing list