[gambit-list] Strange Gambit error problems DS

Andrew Lentvorski bsder at allcaps.org
Thu Oct 26 07:01:22 EDT 2006


Marc Feeley wrote:

> (##heartbeat-interval-set! 1.0)
> (##interrupt-vector-set! 1 (lambda () (display "*")))
> (let loop () (loop))

For some reason, I'm getting a crash if I get a heartbeat interval 
interrupt before I do that (##interrupt-vector-set! ...).  I have to set 
the default interval to something absurdly long and then do the 
(##interrupt-vector-set! ...) in order to avoid a crash.  After that, I 
can lower the heartbeat interval to a useful value.

> By the way, contrary to what I said earlier, the heartbeat interrupts 
> are not necessary for the thread system to work.  However, they are 
> needed for preemptive threads.  You need a complete implementation of 
> the ___time_get_current_time function in lib/os_time.c if you want the 
> timed operations to work (thread-sleep!, timeouts, etc).

Implemented.  Are there any easy ways to to test that time function?

However, the fact that the time values want to be floats isn't very 
friendly to the DS as it doesn't have a floating point unit.

I do see calls to get the current time occurring when I initiate the 
(let loop() (loop)) but not before that.  Is that supposed to happen?

As a side question, has anybody used the integer time functions in a 
while?  I had to patch up some of the main system in order to get them 
to work.

Also, I had to stub out some of the code in 
___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST.  Those checks for 0 
and NULL are a poor substitute for using argc.  I had to hardwire len to 
1 and explicitly zero out allocated memory so that the checks wouldn't 
fail, and it wouldn't smash my stack.

Then, ##path-expand would crash with an unimplemented error.  So, I 
stubbed that out by returning "/".  Finally, the file checks returned 
the correct codes and the system returned a repl.

-a



More information about the Gambit-list mailing list