Re: [PATCH v2 3/3] grep: disable threading in all but worktree case
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Dec 23, 2011, 22:37 UTC
- Message-ID
- <CACBZZX6hboo4wu3fOs+CHnxsdmedxw72GFMVttQzmHzpcZbqoQ@mail.gmail.com>
- In-Reply-To
- <5328add8b32f83b4cdbd2e66283f77c125ec127a.1322830368.git.trast@student.ethz.ch>
On Fri, Dec 2, 2011 at 14:07, Thomas Rast <trast@student.ethz.ch> wrote:
> I conjecture that this is caused by contention on > read_sha1_mutex. [...] So disable threading entirely when not > scanning the worktree
Why does git-grep even need to keep a mutex to call read_sha1_file()? It's inherently a read-only operation isn't it? If the lock is needed because data is being shared between threads in sha1_file.c shouldn't we tackle that instead of completely disabling threading?