RFR: 8293067: (fs) Implement WatchService using system library (macOS) [v3]
Maxim Kartashev
mkartashev at openjdk.org
Thu Sep 22 07:52:12 UTC 2022
On Tue, 20 Sep 2022 21:03:31 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Maxim Kartashev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Removed the change unnecessary without recursive watch
>
> src/java.base/macosx/native/libnio/fs/MacOSXWatchService.c line 73:
>
>> 71: (*env)->CallVoidMethod(env, watchService, callbackMID,
>> 72: streamRef, javaEventPathsArray, eventFlags);
>> 73: }
>
> Is there a way to notify of events without an upcall? Maybe add the necessary values to a queue of some sort observed by the Java layer?
I'm not sure I know how to synchronize native code with Java without any upcall to the Java side; but maybe you are suggesting something as simple as a `notify()` call in place of the current callback with many arguments?.
And also this goes against my understanding that the native part has to be kept as simple and as straightforward as possible. Having it maintain a queue that has to be synchronized with Java will certainly complicate the native part.
-------------
PR: https://git.openjdk.org/jdk/pull/10140
More information about the nio-dev
mailing list