Project

General

Profile

Feature #14757 ยป 0001-thread_pthread.c-enable-thread-cache-by-default.patch

normalperson (Eric Wong), 05/15/2018 12:48 AM

View differences:

thread_pthread.c
870 870
}
871 871
#  endif
872 872

  
873
/*
874
 * number of seconds to cache for, I think 1-5s is sufficient to obviate
875
 * the need for thread pool in many network programs (taking into account
876
 * worst case network latency across the globe) without wasting memory
877
 */
878
#ifndef THREAD_CACHE_TIME
879
#  define THREAD_CACHE_TIME 3
880
#endif
881

  
873 882
static rb_thread_t *
874 883
register_cached_thread_and_wait(rb_nativethread_id_t thread_self_id)
875 884
{
876
    struct timespec end = { 60, 0 };
885
    struct timespec end = { THREAD_CACHE_TIME, 0 };
877 886
    struct cached_thread_entry entry;
878 887

  
879 888
    rb_native_cond_initialize(&entry.cond);
880
-