Review Request 121861: Remove obsolate class KFileSystemWatcher, which is handled by Windows implementation of Qt5 QFileSystemWatcher.

David Faure faure at kde.org
Mon Jan 5 22:06:26 UTC 2015



> On Jan. 5, 2015, 9:37 p.m., David Faure wrote:
> > Ah cool, I didn't know the Qt5 implementation of QFSW solved this. Nice.
> 
> Ralf Habacker wrote:
>     The motivation for KFileSystemWatcher is the following limitation:
>     
>      * the maximum number of object handles is MAXIMUM_WAIT_OBJECTS (64) per thread.
>      * "To wait on more than MAXIMUM_WAIT_OBJECTS handles, create a thread to wait
>      *  on MAXIMUM_WAIT_OBJECTS handles, then wait on that thread plus the other handles.
>      *  Use this technique to break the handles into groups of MAXIMUM_WAIT_OBJECTS."
>      *
>      * QFileSystemWatcher is implemented as thread, so KFileSystemWatcher
>      * allocates more QFileSystemWatcher instances on demand (and deallocates them later).
>      */
>     
>     https://qt.gitorious.org/qt/qtbase/source/73a1e8c60d894701f34806cc4b847aa2814bf389:src/corelib/io/qfilesystemwatcher_win.cpp#L175 and ff looks to me like an implementation to avoid the above mentioned limitation 
>     
>     line 177:     
>     if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) {
>        DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath() << "to existing thread " << thread;
>        ....
>     }
>     line 195:
>     if (!found) {
>         QWindowsFileSystemWatcherEngineThread *thread = new QWindowsFileSystemWatcherEngineThread();
>         DEBUG() << " ###Creating new thread" << thread << "(" << (threads.count()+1) << "threads)";
>     }

Yep, found the commit that fixed this:

commit 0c58fe61b18317d071ac27857bd8cf4d52ec6703
Author: dt <qtc-committer at nokia.com>
Date:   Wed Jul 15 14:23:38 2009 +0200

    Support more than 63 handles in QWindowsFileSystemWatcher
    
    We spawn/stop additional threads as needed to watch any number of
    files/directories. The old logic of using just one handle per watched
    directory (regardless of how many files we watch in it.) is preserved.
    In the worst case a thread is started per 63 files to watch.
    
    This enabled Qt Creator to watch all .pro and .pri files even while
    having qt's projects.pro and qtcreator.pro open.
    
    Task-number: 185259, 253014

So actually this works since Qt 4.6.


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121861/#review73207
-----------------------------------------------------------


On Jan. 5, 2015, 6:43 p.m., Ralf Habacker wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121861/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2015, 6:43 p.m.)
> 
> 
> Review request for KDE Frameworks.
> 
> 
> Repository: kcoreaddons
> 
> 
> Description
> -------
> 
> Remove obsolate class KFileSystemWatcher, which is handled by Windows implementation of Qt5 QFileSystemWatcher.
> 
> 
> Diffs
> -----
> 
>   src/lib/CMakeLists.txt b2b46b164097f2394957f99ec4fb97b52f2bbc96 
>   src/lib/io/kdirwatch.cpp 71f1892180b51cf65426696b4ffe918a02debba0 
>   src/lib/io/kdirwatch_p.h 12839fdf4af5312eae3a636cec73f9dd2a41057d 
>   src/lib/io/kdirwatch_win.cpp 846e91ab1c932fbe1117ca6e3de3008f7f3a2130 
> 
> Diff: https://git.reviewboard.kde.org/r/121861/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ralf Habacker
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150105/8b4185ed/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list