Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-21 Thread Alan Bateman
On Fri, 19 Jan 2024 08:17:00 GMT, Richard Reingruber wrote: > Do you want to keep it then or should I open an RFE to remove it? Maybe leave it for now as there is significant churn in this code right now, with more accumulating in the loom repo in advance of the monitors work. -

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-19 Thread Richard Reingruber
On Fri, 19 Jan 2024 07:57:36 GMT, Alan Bateman wrote: > > I noticed that VirtualThread overrides `isInterrupted` > > Is there a reason to have this override? > > It was necessary at one point but no reason to now except to keep it close at > the source level with the other methods that access

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-19 Thread Alan Bateman
On Fri, 19 Jan 2024 01:56:06 GMT, David Holmes wrote: > Yep my bad on the VM side of things - no change there. But in the nioBlocker > case doesn't this inherently make things more racy? Now maybe those races are > allowed, but this might lead to a change in behaviour. I/O threads always

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-19 Thread Alan Bateman
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread Richard Reingruber
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread David Holmes
On Thu, 18 Jan 2024 09:21:24 GMT, Richard Reingruber wrote: >>> It is really safe/correct to move this outside the synchronized block? I >>> know things have changed a bit with loom but we've "always" held a lock >>> when doing the actual interrupt. I'd have to check the VM logic to be sure

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread Richard Reingruber
On Thu, 18 Jan 2024 08:32:02 GMT, Alan Bateman wrote: >> src/java.base/share/classes/java/lang/Thread.java line 1709: >> >>> 1707: // Setting the interrupt status must be done before reading >>> nioBlocker. >>> 1708: interrupted = true; >>> 1709: interrupt0(); //

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread Alan Bateman
On Thu, 18 Jan 2024 08:02:27 GMT, David Holmes wrote: > It is really safe/correct to move this outside the synchronized block? I know > things have changed a bit with loom but we've "always" held a lock when doing > the actual interrupt. I'd have to check the VM logic to be sure it can be >

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread Richard Reingruber
On Wed, 17 Jan 2024 21:18:27 GMT, Christoph Langer wrote: >> Richard Reingruber has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Review Alan > > test/jdk/java/nio/channels/Selector/LotsOfInterrupts.java line 2: > >> 1: /* >> 2: *

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-18 Thread David Holmes
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-17 Thread Christoph Langer
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-17 Thread Richard Reingruber
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-17 Thread Alan Bateman
On Wed, 17 Jan 2024 15:38:22 GMT, Richard Reingruber wrote: >> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for >> correct (Dekker scheme) synchronization with concurrent execution of >>

Re: RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

2024-01-17 Thread Richard Reingruber
> Set `interrupted` in `Thread::interrupt` before reading `nioBlocker` for > correct (Dekker scheme) synchronization with concurrent execution of >