List Info

Thread: Modifying interface for ASync Project Opening




Modifying interface for ASync Project Opening
user name
2007-05-31 08:59:56
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 

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Modifying interface for ASync Project Opening
user name
2007-05-31 10:36:29
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.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Modifying interface for ASync Project Opening
user name
2007-05-31 15:24:52
On Thursday 31 May 2007 08:59, 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()
>
> 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 
>

It's not really valuable and there are ways to make the GUI
appear 
non-blocking even though it's not really. Let's just go with
non-threaded 
project parsing.
-- 
Matt

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )