chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] thread scheduling: how about an idle-thread-hook?


From: Perry E. Metzger
Subject: Re: [Chicken-users] thread scheduling: how about an idle-thread-hook?
Date: 13 Aug 2002 10:49:31 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"felix" <address@hidden> writes:
> Nothing too sophisticated, it just decorated the source code with lots
> of `dynamic-wind's and such. This worked quite well, but the problem
> was that the code was blown up extraordinarily. It would have to be
> done on a a lower-level (i.e. when generating C code).

It would seem that putting some hooks in to the generated code in the
compiler would make both profiling and debugging easier, wouldn't it?
It might be worthwhile to have some sort of system for explicitly
adding code on function entry/exit...

Perry

> So you would have (roughly):
> 
> Original:
> 
> (define (foo . x)
>     (reverse x) )
> 
> (foo 1 2 3)
> 
> Debugged:
> 
> (define (foo . args)
>   (dynamic-wind
>     (lambda () (##sys#dbg-entry 'foo args))
>     (lambda ()
>       (call-with-values
>         (lambda () (apply (lambda x (reverse x)) args))
>         (lambda results
>            (##sys#dbg-exit 'foo results) ) )
>     (lambda () #f) ) )
> 
> (##sys#dbg-call foo 1 2 3)
> 
> 
> cheers,
> felix
> 
> 
> 
> 
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/chicken-users
> 

-- 
Perry E. Metzger                address@hidden
--
"Ask not what your country can force other people to do for you..."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]