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

Re: [PATCH 2/2] pkt-line: show packets in async processes as "sideband"

From
Jeff King <peff@peff.net>
Date
Sep 1, 2015, 22:22 UTC
Message-ID
<20150901222230.GB7862@sigill.intra.peff.net>
In-Reply-To
<xmqq1tehrdoa.fsf@gitster.mtv.corp.google.com>
On Tue, Sep 01, 2015 at 03:13:25PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> > So instead, let us just assume that any async process is
> > handling sideband data. That's always true now, and is
> > likely to remain so in the future.
> 
> Hmm, does Stefan's thread-pool thing interact with this decision in
> any way?
I don't think so. It is true that:
  start_async(...);
  finish_async(...);
  pthread_create(foo);

would incorrectly report in_async() inside the foo function (because we know that async has been kicked off, and we know that we are in a thread that is not the main one).

But I don't think it matters in the current code base, because we tend to use async for I/O tasks like muxing/demuxing, and real threads in CPU-heavy tasks like pack-objects.

Still, I admit it is a little gross, and may be a problem in the future.

An alternate approach would be to have the async system provide a thread-local storage abstraction. With pthreads, we'd build on pthread_setspecific(), and without, it becomes a simple global variable.

That's more work, but a lot less error-prone, and it may come in handy in the future.

-Peff
Previous: Junio C HamanoNext: Stefan Beller
Message 8 of 12 in “clarify sideband muxing in GIT_TRACE_PACKET”
  1. 0/2 clarify sideband muxing in GIT_TRACE_PACKETJeff King, Sep 1, 2015
  2. 1/2 run-command: provide in_async query functionJeff King, Sep 1, 2015
  3. Jeff KingSep 1, 2015
  4. Junio C HamanoSep 1, 2015
  5. Jeff KingSep 1, 2015
  6. 2/2 pkt-line: show packets in async processes as "sideband"Jeff King, Sep 1, 2015
  7. Junio C HamanoSep 1, 2015
  8. Jeff KingSep 1, 2015
  9. Stefan BellerSep 1, 2015
  10. Jeff KingSep 1, 2015
  11. Stefan BellerSep 1, 2015
  12. Jeff KingSep 1, 2015

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.