Re: Libification project (SoC)
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Mar 17, 2007, 07:04 UTC
- Message-ID
- <e5bfff550703170004n3ab9075euf66a9e6dd56040d7@mail.gmail.com>
- In-Reply-To
- <Pine.LNX.4.63.0703170014130.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On 3/17/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > We are talking about libgit. Which should make access to certain common > functions on Git repositories easy. Nothing more than that. >
Fair enough.
Show 11 quoted lines
> If you need to do that asynchronously, do _not_ fiddle with libgit. Just > imagine what this would involve: you'd have to have timeouts (since there > is _NO_ other way to find out when to return with empty hands, instead of > blocking), which is _not_ portable. You'd soon be in the same _mess_ we > are talking about with respect to exceptions. > > Also, you would make _all_ operations expensive, since they _would_ have > to store state to be restartable. > > The common solution for your problem _is_ to use threads. >
I would say, the common solution to have non blocking libgit is to use threads in the tool linked with libgit.
This is clearly a design choice and I agree it's an important statement to keep libgit simple and portable (otherwise you'd probably need to use a thread library as pthread in libgit). Thread facility in Qt is instead already portable and well integrated. Anyway it's a design choice perhaps worth documenting.
> And you have to admit that _only_ viewers would need asynchronous access > anyway. I doubt that other tools -- which could take their advantage of a > libgit -- would need such an access. >
Yes, and you have to admit ;-) that viewers are the tools that mostly will use libgit.
Marco