[KDev4] Modifying interface for ASync Project Opening

dukju ahn dukjuahn at gmail.com
Thu May 31 13:59:56 UTC 2007


The two problems regarding ASync project openning is summarized as,
1. We shouldn't create QObject in one thread and call its method
 at other thread.
2. QObject should be moved into main GUI thread before the project
parsing QThread is deleted.

Currently, I can't see use-case for number 2. For number 1, I already
used QFileSysWatcher. The problem is that QFileSystemWatcher is
created at main thread, but QFileSystemWatcher::addFile is called
in IProjectFileManager::parse(), which is run in separate thread.

So I suggest this -- we have additional
IProjectFileManager::parseCleanup( IProject* ), and call this in GUI
thread after the recursive parse() thread is finished. In parseCleanup()
we will complete some delayed QObject stuffs. For example, rather than
calling QFileSysWatcher::addFile() directly in parsing thread, I'd just
queue the file list to be added. And in parseCleanup() I actually call
QFileSysWatcher::addFile()

Anyway, it is evident that project parsing becomes more slower when
we use thread, although we accquire non-blocking GUI. I'm not sure
whether this trade-off is valuable or not.

I expect any objections as before :)




More information about the KDevelop-devel mailing list