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

Ralf Habacker ralf.habacker at freenet.de
Mon Jan 5 21:48:18 UTC 2015



> On Jan. 5, 2015, 10:37 nachm., David Faure wrote:
> > Ah cool, I didn't know the Qt5 implementation of QFSW solved this. Nice.

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)";
}


- Ralf


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


On Jan. 5, 2015, 7:43 nachm., Ralf Habacker wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121861/
> -----------------------------------------------------------
> 
> (Updated Jan. 5, 2015, 7:43 nachm.)
> 
> 
> 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/091ca8bc/attachment.html>


More information about the Kde-frameworks-devel mailing list