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

Re: [PATCHv2] attr: convert to new threadsafe API

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 12, 2016, 20:59 UTC
Message-ID
<xmqqpon52shy.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kaBhXHLDEK0XMLjm3QofmtaGZspA3EEx5x4-qCYY--wZA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
>>> Well all of the hunks in the patch are not threaded, so they
>>> don't follow a threading pattern, but the static pattern to not be
>>> more expensive than needed.
>>
>> Is it too invasive a change to make them as if they are thread-ready
>> users of API that happen to know their callers are not threading?
>> It would be ideal if we can prepare them so that the way they
>> interact with the attr subsystem will not have to change after this
>> step.
>
> As far as I see the future, we do not need to change those in the future,
> unless we add the threading to the current callers, which is usually a very
> invasive thing?

It does not matter how invasive the thread set-up and teardown that happens in the callers.

I am talking about the part of _THIS_ code that you are updating, that interacts with attr API. The way they prepare "check" and "result", the way they ask questions by calling git_check_attr() function.

Think of a thread-safe library function (like malloc()). If you write

	func (...) {
		buf = malloc(20);
		...
		free(buf);
	}

in a function that happens to be only called in a non-threaded program today, you do not have to update these calls to malloc(3) and free(3) when you update the callchain to threadable, right?

That kind of thread-preparedness is what I am trying to see if we can achieve with this update.

Previous: Stefan BellerNext: Junio C Hamano
Message 6 of 16 in “[PATCHv2] attr: convert to new threadsafe API”
  1. Stefan BellerOct 11, 2016
  2. Junio C HamanoOct 12, 2016
  3. Stefan BellerOct 12, 2016
  4. Junio C HamanoOct 12, 2016
  5. Stefan BellerOct 12, 2016
  6. Junio C HamanoOct 12, 2016
  7. Junio C HamanoOct 12, 2016
  8. Johannes SixtOct 12, 2016
  9. Junio C HamanoOct 12, 2016
  10. Stefan BellerOct 12, 2016
  11. Junio C HamanoOct 12, 2016
  12. Jacob KellerOct 12, 2016
  13. Stefan BellerOct 12, 2016
  14. Junio C HamanoOct 12, 2016
  15. Stefan BellerOct 12, 2016
  16. Junio C HamanoOct 12, 2016

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.