Remove thread from QFileSystemWatcherEngine implementations.
authorRobin Burchell <robin.burchell@collabora.com>
Thu, 29 Dec 2011 22:56:27 +0000 (23:56 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 10 Jan 2012 15:19:32 +0000 (16:19 +0100)
commitd7ec8bf29ad2f9668c258e9c05012f4a5a0063da
treec7df9d344880d5279773f537456d5cd5d4010c9d
parent3e4f7ed5ed29c907815f5bae2628e417c340efbc
Remove thread from QFileSystemWatcherEngine implementations.

These threads are actually counterproductive, as generally speaking, processing
watches is not that expensive an operation, so instead, they process at full
speed and can (in the case of slow processing in the thread processing the
events) stack up and consume resources for no good reason.

Threads also have an additional resource consumption per engine (some ~8mb of
thread stack on Linux), so doing away with them is nice.

A side effect of this change is that events are now effectively rate-limited by
the eventloop speed of the thread they run in, so if your thread runs too slow,
and you recieve a lot of events, on some platforms, events may be dropped now
where in the past, they would be read by the monitor thread and turned into Qt
signals (thus not visibly showing as a problem, apart from invisibly bloating
memory usage).

Task-number: QTBUG-20028
Change-Id: I345a56a8c709f6f778ca9a0b55b57c05229ba477
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
src/corelib/io/qfilesystemwatcher.cpp
src/corelib/io/qfilesystemwatcher_inotify.cpp
src/corelib/io/qfilesystemwatcher_inotify_p.h
src/corelib/io/qfilesystemwatcher_kqueue.cpp
src/corelib/io/qfilesystemwatcher_kqueue_p.h
src/corelib/io/qfilesystemwatcher_p.h
src/corelib/io/qfilesystemwatcher_polling.cpp
src/corelib/io/qfilesystemwatcher_polling_p.h
src/corelib/io/qfilesystemwatcher_win.cpp
src/corelib/io/qfilesystemwatcher_win_p.h