[gambit-list] Leopard bug causing extremely slow parsing times

Patrick Kelly e at pdk.to
Sat Nov 10 00:26:55 EST 2007


I think I did this right.  It took me a while to realize that I needed
to make the change in _thread.scm, AND do all the "save some time"
steps.

Anyway, now I'm trying to run "make check" and it hangs on

../gsi/gsi -f mix.scm > test4.out

I saw this in tests/mix.scm:

(define heartbeat-interval
  (##thread-heartbeat-interval-set! 0.0)) ; set and get smallest interval

I tried changing to 0.01, but that caused a pretty nasty blowout.

Is there a way to get this test to pass, or to skip it?

thanks

On Oct 29, 2007 8:56 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:

> The problem is not with I/O. Apparently MacOS X has a very high
> resolution interval timer (setitimer). When the Gambit thread system
> is initialized, it sets up the interval timer for implementing the
> thread quantum. In _thread.scm you will find this call:
>
> (##thread-heartbeat-interval-set! (macro-inexact-+0))
>
> which is the same as
>
> (##thread-heartbeat-interval-set! 0.0)
>
> The value 0.0 is a special value indicating that the shortest possible
> time interval should be used. On MacOS 10.4 this time is 1e-2 or 1e-3
> seconds (I don't remember which, but fairly coarse). On MacOS 10.5 the
> time is 1e-6, i.e. one microsecond! Because the quantum is so small,
> the system is spending a lot of time being interrupted by the timer
> for no good reason.
>
> I just installed MacOS 10.5 and haven't yet installed Mercurial (so I
> can't upload a patch). In the meantime simply replace the problematic
> line in lib/_thread.scm by
>
> (##thread-heartbeat-interval-set! 0.01)
>
> and run "make".  Note that the compiler will take forever to compile
> lib/_thread.scm (because gsc-comp will be running with a heartbeat
> interval of 1e-6 second).  If you want to save some time do this:
>
> % cd lib
> % echo "(##thread-heartbeat-interval-set! 0.01)" > gambcini.scm
> % ../gsc-comp -:=.. -c -check _thread.scm
> % ../gsc-comp -:=.. -link -flat -o _gambc.c _kernel.c _system.c _num.c
> _std.c _eval.c _io.c _nonstd.c _thread.c _repl.c
> % make
> % cd ../gsc
> % echo "(##thread-heartbeat-interval-set! 0.01)" > gambcini.scm
> % ../gsc-comp -:=".." -link _host.c _utils.c _source.c _parms.c _env.c
> _ptree1.c _ptree2.c _gvm.c _back.c _front.c _prims.c _t-c-1.c _t-c-2.c
> _t-c-3.c _gsc.c
> % make
> % cp gsc ../gsc-comp
> % cd ..
> % make
>
>



More information about the Gambit-list mailing list