> Why don't we leave it at 8, then? That's the conservative choice, and
> once we have --threads, people can easily experiment with different
> values and we can follow-up with a change to the default if need be.

I'd propose the following:

    if (list.nr || cached) {                                                    
                                        
        num_threads = 0; /* Can not multi-thread object lookup */               
                                        
    }                                                                           
                                        
    else if (num_threads < 0 && online_cpus() <= 1) {                           
                                        
        num_threads = 0; /* User didn't set threading option and we have <= 1 
of hardware cores */                      
    }                                                                           
                                        
    else if (num_threads == 0) {                                                
                                        
        num_threads = GREP_NUM_THREADS_DEFAULT; /* User explicitly choose 
default behavior */                           
    }                                                                           
                                        
    else if (num_threads < 0) {  /* Actually this one should be checked earlier 
so no need to double check here */                                              
                                         
        die(_("Ivalid number of threads specified (%d)"), num_threads)          
                                        
    }     

--
Victor
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to