[JDK-7133447] OSX optimized WatchService

Brian Burkhalter brian.burkhalter at oracle.com
Fri Dec 11 21:01:54 UTC 2020


Hello Andres / Christian,

> On Dec 11, 2020, at 12:51 PM, Christian Stein <sormuras at gmail.com> wrote:
> 
> // Posting on behalf of Andres Almiray
> 
> Hello everyone,
> At the Layrry project we encountered this particular issue while trying to shed external dependencies and rely on as many JDK-only APIs as possible.
> 
> Specifically the OSX WatchService from https://github.com/gmethvin/directory-watcher <https://github.com/gmethvin/directory-watcher> is capable of reacting to directory changes much faster (almost instantaneously at least to the naked eye) than the OSX WatchService provided by OpenJDK (which takes a couple of seconds to react, very noticeable).

Yes the extant WatchService on macOS is based on polling and is relatively slow.

> https://bugs.openjdk.java.net/browse/JDK-7133447 <https://bugs.openjdk.java.net/browse/JDK-7133447> was created close to 9 years ago and no updates have been posted since.

I spent some time trying to solve this one using Kqueues but so far did not succeed in fixing it. I am not sure whether that approach can work.

> Unfortunately I don’t have any experience with code required to provide a patch but I’m willing to help testing out any patches and/or with other tasks that can bring this ticket to a fruitful solution.

Are you suggesting making a contribution to fix this, or simply validating a solution we come up with? If the former, that would be most welcome provided it can be done under the conditions require, e.g., signed OCA, etc., but that seems already to be in place.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20201211/45b315ba/attachment-0001.htm>


More information about the nio-dev mailing list