[Development] Should QFileSystemWatcher be thread-safe? (Qt 5.8.0)

Thiago Macieira thiago.macieira at intel.com
Sun Oct 1 09:02:25 CEST 2017


On Saturday, 30 September 2017 02:31:13 PDT René J. V. Bertin wrote:
> > You cannot, because neither the kqueue, inotify or poll backends do that.
> > Those three have no mutexes at all. You have to block the event loop of
> > the
> > thread they were created on.
> 
> That all applies to multithreaded usage, right? What happens when a change
> is signalled while an item is being added *on the same thread*? At least
> the kqueue and inotify backends are written around an API that sends
> asynchronous notifications, no?

There's no such thing that you're describing. Like Konrad said, inotify and 
kquee notify by way of file descriptors and standard Unix event looping. Since 
everything is happening in the same thread, then a change can't be signalled 
*while* an item is being added. Things only happen serially.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list