From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
msysgit@googlegroups.com
Subject: Re: [PATCH] git grep: be careful to use mutices only when they are initialized
Date: Thu, 27 Oct 2011 17:27:04 +0200 [thread overview]
Message-ID: <4EA97848.9080008@lsrfire.ath.cx> (raw)
In-Reply-To: <7vmxcn1pob.fsf@alter.siamese.dyndns.org>
Am 26.10.2011 22:08, schrieb Junio C Hamano:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> The remainder of this message are hints and random thoughts on potential
>> follow-up patches that may want to build on top of this patch for further
>> clean-ups (not specifically meant for Dscho but for other people on both
>> mailing lists).
>> ...
>> - Could we lose "#ifndef NO_PTHREADS" inside grep_sha1(), grep_file(),
>> and possibly cmd_grep() functions and let the compiler optimize things
>> away under NO_PTHREADS compilation?
>
> I suspect that the result of the conversion would look a lot cleaner if
> the code is first cleaned up to move global variable like skip_first_line
> and the mutexes into the grep_opt structure. Without such clean-up, I do
> not think a conversion like this does not add much value.
Each thread get its own copy of the grep_opt struct, but the mutexes and
also skip_first_line must not be duplicated. They could be moved into a
new struct that is pointed to by grep_opt, but I'm not sure it's a win.
René
next prev parent reply other threads:[~2011-10-27 15:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-25 17:25 [PATCH] git grep: be careful to use mutices only when they are initialized Johannes Schindelin
2011-10-26 9:10 ` [msysGit] " Tay Ray Chuan
2011-10-26 15:42 ` Johannes Schindelin
2011-10-26 9:19 ` Pat Thoyts
2011-10-26 17:17 ` Junio C Hamano
2011-10-26 18:57 ` Johannes Schindelin
2011-10-26 20:02 ` Junio C Hamano
2011-10-26 20:04 ` Junio C Hamano
2011-10-26 20:08 ` Junio C Hamano
2011-10-27 15:27 ` René Scharfe [this message]
2011-10-27 18:02 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EA97848.9080008@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=msysgit@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).