guile-devel
[Top][All Lists]
Advanced

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

Re: Idea for safe signal handling by a byte code interpreter


From: Hong Zhang
Subject: Re: Idea for safe signal handling by a byte code interpreter
Date: Thu, 22 Mar 2001 15:04:47 -0800

>     >> What if, at the C level, you had a signal handler that sets or
>     >> increments a flag or counter, stuffs a struct with information
about
>     >> the signal's context, then pushes (by "push", I mean "(cons v ls)",
>     >> not "(append! ls v)" 'whatever ;-) that struct on a stack...
>
>     Hong> I don't believe there is any way to push anything on the stack
inside
>     Hong> signal handler without breaking the interpreter. Remember the
signal
>     Hong> context is not useful outside signal handler.
>
>  I don't mean "the stack", but "a stack"; one created just for this
purpose.

"a stack" is still too easy to get overflow. And will be difficult to manage
in threaded environment, malloc() is not allowed inside signal handler.
A simple signal count will be much easier to deal with.

I tried to give a concrete solution here. I have used this solution for
HotSpot java virtual machine for Linux, and it works fine.

Hong




reply via email to

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