On Wed, 2006-11-08 at 09:57 -0800, Erick Tryzelaar wrote:

> signals are quite tricky to deal with when you got garbage collection :) 
> I found a mailing about how ocaml does it:
> 

> They're basically putting a placeholder function in the signal, and 
> sprinkle a check all over the code to see if any signals came through. 
> It's messy, but it allows you to have fully heaped and gc'd code. Any 
> other ways of doing this?

It depends on OS support. 

A signal is basically a Felix procedure
with a resume method which is called asynchronously.

So you just run an ordinary Felix procedure in a pthread,
and block waiting for a signal. The signal stores data 
somewhere, and the procedure picks it up.

The data buffer will be finite of course .. if you get
too many signals too fast you're screwed. This is one
case where you probably HAVE to use global storage
(absolute addressing) .. since the signal has no 
other context.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to