VCS Interface classes (async execution)

Andreas Pakulat apaku at gmx.de
Wed May 2 17:27:02 UTC 2007


On 02.05.07 11:14:59, Matthew Woehlke wrote:
> Jakob Petsovits wrote:
> > On Monday, 30. April 2007, Andreas Pakulat wrote:
> >> I present to you our new VCS interface classes (that I finally managed
> >> to write up, based on the enourmus thread some time ago).
> > 
> > Other question: is it ok to let each VCS plugin reinvent threading?
> 
> Andreas brought up the idea of using KJob. Probably you will not 
> reimplement threading, but use some standard job class.

Uhm, as dukju already found KJob doesn't to any threading or such
things. You have to do that yourself, so this point is valid. However
not all plugins may need a separate thread, for example cvs runs the
client and parses its output (I guess) so we don't need a thread here.

> > Is it really necessary to let plugins keep track of their action calls?
> > How long after the call are they supposed to keep the action ids?
> 
> I don't think the plugin needs to keep track of its calls at all, that's 
> the caller's responsibility.

I think thats exactly what Jakob meant, the callers have to keep track
of the jobs.

> > How about defining the interface synchronous and having one threading wrapper 
> > in shell itself? Like,
> > 
> > AsyncBasicVersionControlWrapper asyncBasicVC =
> >     new AsyncBasicVersionControlWrapper (basicVC);
> > asyncBasicVC->add( myDir, IBasicVersionControl::Recursive );
> > doOtherStuffInTheMeantime();
> > 
> > Then the plugin still has to be threadsafe, but at least doesn't need to take 
> > care of all that nasty stuff by itself, shell would do it for them.
> 
> I also suggested that. I don't think it's /needed/ if we can easily 
> leverage a job class, but...

Well, maybe I'm blind but I don't really see how this would work. I mean
we'd have to have such a wrapper class for each iface and the wrapper
class has to copy the API of the interface plus provide a way to report
back the result of executing a method. IMHO thats too much work, at
least waiting for a KJob to be finished is pretty easy and if needed we
can provide specialized KJobs which carry the return value in them (once
they are finished).

Andreas

-- 
You will lose your present job and have to become a door to door mayonnaise
salesman.




More information about the KDevelop-devel mailing list