[Vm-dev] Custom signal handler?

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 30 05:15:40 UTC 2015





_,,,^..^,,,_ (phone)
> On Dec 29, 2015, at 2:38 AM, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
> 
> Hi guys,
> 
> I am checking UnixOSProcessPlugin >> primitiveForwardSignalToSemaphore and it seems it needs to do quite some work in order to place a signal handler for things like SIGCHLD in order to get a Smalltalk semaphore signaled upon receiving SIGCHLD or whatever signal.
> 
> So...I wonder...is there something today (nowadays) in latest VM that would allow me to set such a handler without such kind of primitive?

No.  You could use the FFI and a callback to call signal but since signal delivery is asynchronous it would cause havoc when the signal invoked the callback at an arbitrary time.

 If signal handlers can be installed that deliver to a specific thread (ptherad_signal?) and you set it to deliver to some dedicated thread that is idling then the threaded FFI would manage the timing.

(& running on bare metal as in SqueakNOS requires enable/disable interrupts to allow interrupt delivery at appropriate times)

> 
> Thanks in advance,
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151230/5c8d7bba/attachment.htm


More information about the Vm-dev mailing list