[KDev4] Modifying interface for ASync Project Opening

Andreas Pakulat apaku at gmx.de
Thu May 31 15:36:29 UTC 2007


On 31.05.07 09:59:56, dukju ahn wrote:
> 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()

I can't say I really like that approach, although I don't have any exact
objections its just that it feels wrong to me....

> 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.

Have you considered using event-posting or queued connections instead of
direct calls? That way some parts will be done in the GUI thread. 

Anyway, if this is more than a 30 minute hack I think you should just
revert to non-threaded parsing, as Matt already said this isn't that
important to waste so much time. Especially if opening a project is now
fast enough, when we need threaded opening we can get back to this later
on.

Andreas 

-- 
Your heart is pure, and your mind clear, and your soul devout.




More information about the KDevelop-devel mailing list