git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Libification project (SoC)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 16, 2007, 23:24 UTC
Message-ID
<Pine.LNX.4.63.0703170014130.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<e5bfff550703161407u6afefae9u4a23cf1cb49125ce@mail.gmail.com>
Hi,
On Fri, 16 Mar 2007, Marco Costalba wrote:
Show 13 quoted lines
> On 3/16/07, Nicolas Pitre <nico@cam.org> wrote:
> > On Fri, 16 Mar 2007, Marco Costalba wrote:
> > 
> > > On 3/16/07, Marco Costalba <mcostalba@gmail.com> wrote:
> > > >
> > > > *The most important thing for a libgit to be used by qgit is 
> > > > reentrancy*
> > > >
> > >
> > > Another crtitical feature is that this call to git-rev-list-like
> > > function MUST be non-blocking.
> > 
> > I'm not sure I agree.
I am sure I don't agree.
Show 8 quoted lines
> > The non-blockingness can be (and probably should be) handled at a 
> > higher level with your own threading facility of choice.  Making GIT 
> > restartable has the potential for making the core code much too 
> > complex.
> 
> The fact is that the solution is complex anyway, moving the complex code 
> at higher level doesn't simplify the whole issue, it just *moves* the 
> issue somewhere else.

It not only *moves* the issue somewhere else, but it also cleanly separates the issues.

> BTW now qgit is single-threaded (as gitk), you suggest that linking with 
> libgit it will involve to go on the multi threading side and I think you 
> are right. But it will be not that easy.
Why?

First, it _is_ multi-threaded, since it calls external programs. That is even more than a thread. It is a process.

Second, it _would_ be easy to just use the threads provided by Qt.
> Because we are just speaking (well, writing ;-) ) about a possible 
> library I think we could take in account what would involve to foreseen 
> a callback mechanism in the API, at least for the slowest ones.

We are talking about libgit. Which should make access to certain common functions on Git repositories easy. Nothing more than that.

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.

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.

Ciao, Dscho

Previous: Marco CostalbaNext: Marco Costalba
Message 21 of 62 in “Libification project (SoC)”
  1. Luiz Fernando N. CapitulinoMar 16, 2007
  2. Shawn O. PearceMar 16, 2007
  3. Junio C HamanoMar 16, 2007
  4. Shawn O. PearceMar 16, 2007
  5. Junio C HamanoMar 16, 2007
  6. Johannes SchindelinMar 16, 2007
  7. Rocco RutteMar 16, 2007
  8. Johannes SchindelinMar 16, 2007
  9. Nicolas PitreMar 16, 2007
  10. Johannes SchindelinMar 16, 2007
  11. Nicolas PitreMar 16, 2007
  12. Steve FrécinauxMar 16, 2007
  13. Nicolas PitreMar 16, 2007
  14. Petr BaudisMar 18, 2007
  15. Johannes SchindelinMar 16, 2007
  16. Shawn O. PearceMar 16, 2007
  17. Marco CostalbaMar 16, 2007
  18. Marco CostalbaMar 16, 2007
  19. Nicolas PitreMar 16, 2007
  20. Marco CostalbaMar 16, 2007
  21. Johannes SchindelinMar 16, 2007
  22. Marco CostalbaMar 17, 2007
  23. Johannes SchindelinMar 17, 2007
  24. Andy ParkinsMar 16, 2007
  25. Petr BaudisMar 18, 2007
  26. Johannes SchindelinMar 18, 2007
  27. Petr BaudisMar 19, 2007
  28. Johannes SchindelinMar 19, 2007
  29. Theodore TsoMar 19, 2007
  30. Shawn O. PearceMar 19, 2007
  31. Johannes SchindelinMar 19, 2007
  32. Linus TorvaldsMar 19, 2007
  33. Linus TorvaldsMar 19, 2007
  34. Andreas EricssonMar 21, 2007
  35. Linus TorvaldsMar 21, 2007
  36. Andreas EricssonMar 22, 2007
  37. Marco CostalbaMar 19, 2007
  38. Steve FrécinauxMar 19, 2007
  39. Steve FrécinauxMar 19, 2007
  40. Johannes SchindelinMar 19, 2007
  41. Petr BaudisMar 19, 2007
  42. Johannes SchindelinMar 19, 2007
  43. Marco CostalbaMar 19, 2007
  44. Petr BaudisMar 16, 2007
  45. Luiz Fernando N. CapitulinoMar 16, 2007
  46. Petr BaudisMar 16, 2007
  47. Luiz Fernando N. CapitulinoMar 16, 2007
  48. Shawn O. PearceMar 16, 2007
  49. Luiz Fernando N. CapitulinoMar 17, 2007
  50. Shawn O. PearceMar 18, 2007
  51. Junio C HamanoMar 18, 2007
  52. Luiz Fernando N. CapitulinoMar 18, 2007
  53. Junio C HamanoMar 18, 2007
  54. Luiz Fernando N. CapitulinoMar 19, 2007
  55. Nicolas PitreMar 18, 2007
  56. Johannes SchindelinMar 16, 2007
  57. Johannes SixtMar 16, 2007
  58. Matthieu MoyMar 16, 2007
  59. Johannes SchindelinMar 16, 2007
  60. Petr BaudisMar 16, 2007
  61. Jakub NarebskiMar 17, 2007
  62. Shawn O. PearceMar 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.