Branch: Tag:

2007-06-10

2007-06-10 18:11:13 by Martin Stjernholm <mast@lysator.liu.se>

Added support for POSIX style timers using clock_gettime(3). Notably this
fixes nice high resolution thread local cpu time and monotonic real time on
reasonably modern Linux systems.

Also added a few more pike constants about various characteristics of the
cpu/real time interfaces in use.

Rev: src/acconfig.h:1.155
Rev: src/builtin_functions.c:1.640
Rev: src/configure.in:1.1019
Rev: src/gc.c:1.290
Rev: src/gc.h:1.129
Rev: src/modules/system/system.c:1.182
Rev: src/pike_rusage.h:1.18
Rev: src/rusage.c:1.46
Rev: src/threads.c:1.254
Rev: src/threads.h:1.132

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: gc.c,v 1.289 2007/06/10 12:49:47 mast Exp $ + || $Id: gc.c,v 1.290 2007/06/10 18:11:13 mast Exp $   */      #include "global.h"
120:   static double objects_freed = 0.0;   static double gc_time = 0.0, non_gc_time = 0.0;   static cpu_time_t last_gc_end_time = 0; - #if CPU_TIME_IS_THREAD_LOCAL == PIKE_NO + #ifdef CPU_TIME_MIGHT_NOT_BE_THREAD_LOCAL   cpu_time_t auto_gc_time = 0;   #endif   
3691:    alloc_threshold = (ALLOC_COUNT_TYPE) new_threshold;       if (!explicit_call && last_gc_time != (cpu_time_t) -1) { - #if CPU_TIME_IS_THREAD_LOCAL == PIKE_YES + #ifdef CPU_TIME_MIGHT_BE_THREAD_LOCAL +  if (cpu_time_is_thread_local)    Pike_interpreter.thread_state->auto_gc_time += last_gc_time; - #elif CPU_TIME_IS_THREAD_LOCAL == PIKE_NO +  else + #endif +  { + #ifdef CPU_TIME_MIGHT_NOT_BE_THREAD_LOCAL    auto_gc_time += last_gc_time;   #endif    } -  +  }       if(GC_VERBOSE_DO(1 ||) gc_trace)    {