Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-29 Thread Junio C Hamano
Jeff King writes: > On Mon, Oct 29, 2018 at 05:01:41PM +0100, Duy Nguyen wrote: > >> On Mon, Oct 29, 2018 at 3:25 PM Jeff King wrote: >> > But if the problem is simply that we are not quite there yet in the grep >> > code, I am OK with taking this as the first pass, and knowing that there >> >

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-29 Thread Jeff King
On Mon, Oct 29, 2018 at 05:01:41PM +0100, Duy Nguyen wrote: > On Mon, Oct 29, 2018 at 3:25 PM Jeff King wrote: > > But if the problem is simply that we are not quite there yet in the grep > > code, I am OK with taking this as the first pass, and knowing that there > > is more cleanup to be done

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-29 Thread Duy Nguyen
On Mon, Oct 29, 2018 at 3:25 PM Jeff King wrote: > But if the problem is simply that we are not quite there yet in the grep > code, I am OK with taking this as the first pass, and knowing that there > is more cleanup to be done later (though that sort of thing is IMHO very > useful in a commit

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-29 Thread Jeff King
On Mon, Oct 29, 2018 at 11:16:39AM +0900, Junio C Hamano wrote: > Jeff King writes: > > > Cases like this are kind of weird. I'd expect to see wait_all() return > > immediately when !HAVE_THREADS. But we don't need to, because later we > > do this: > > > >> - if (num_threads) > >> + if

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-28 Thread Junio C Hamano
Jeff King writes: > Cases like this are kind of weird. I'd expect to see wait_all() return > immediately when !HAVE_THREADS. But we don't need to, because later we > do this: > >> -if (num_threads) >> +if (HAVE_THREADS && num_threads) >> hit |= wait_all(); > > Which I think

Re: [PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-27 Thread Jeff King
On Sat, Oct 27, 2018 at 09:09:59AM +0200, Nguyễn Thái Ngọc Duy wrote: > diff --git a/builtin/grep.c b/builtin/grep.c > index d8508ddf79..29221e1003 100644 > --- a/builtin/grep.c > +++ b/builtin/grep.c > @@ -34,7 +34,6 @@ static int recurse_submodules; > #define GREP_NUM_THREADS_DEFAULT 8 >

[PATCH 06/10] grep: remove #ifdef NO_PTHREADS

2018-10-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/grep.c | 58 +- grep.c | 6 -- grep.h | 6 -- 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/builtin/grep.c b/builtin/grep.c index d8508ddf79..29221e1003