# Embedded Ruby 1.9.1, signals and multithreading

**URL:** <https://www.ruby-forum.com/t/embedded-ruby-1-9-1-signals-and-multithreading/176153>\
**Category:** Ruby\
**Created:** [September 25, 2009, 11:57am UTC](https://www.ruby-forum.com/t/embedded-ruby-1-9-1-signals-and-multithreading/176153 "2009-09-25T11:57:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![corck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@corck](https://www.ruby-forum.com/u/corck)\
**Post date:** [September 25, 2009, 11:57am UTC](https://www.ruby-forum.com/t/embedded-ruby-1-9-1-signals-and-multithreading/176153/1 "2009-09-25T11:57:50Z")

</div>

Hello,

I have some question abouts the signal handling in 1.9.1 and haven’t  
found any docs so I am asking here -  
based on assumptions of course so please correct me if I am mistaken.

I am author of a window manager (subtle) and embed ruby as scripting  
language. Since the switch from  
1.8 to 1.9 I am facing many problems with asynchronous signals in  
multithreading.

How is signal handling supposed to work and does the thread that ruby  
creates automatically have any own  
signal handlers? Due the asynchronous behaviour of signals like SIGINT  
the first thread with a handler will get  
the signal and this is sometimes not my main thread.

Also when this ruby thread has any handler, can some signals be disabled  
or should I just add traps and rely  
fully on ruby and dispatch the signals to my main thread?

Thanks in advance.

Wbr, Christoph

---

<div class="post-metadata">

**Author:** ![corck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/90db22/32.png) [@corck](https://www.ruby-forum.com/u/corck)\
**Post date:** [September 29, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/embedded-ruby-1-9-1-signals-and-multithreading/176153/2 "2009-09-29T13:37:22Z")

</div>

Is there really nobody who can say anything about this or is it just the  
wrong ML?

---- On Fri, 25 Sep 2009 02:56:51 -0700 Christoph K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote ----

> Hello,
> 
> I have some question abouts the signal handling in 1.9.1 and haven’t  
> found any docs so I am asking here -  
> based on assumptions of course so please correct me if I am mistaken.
> 
> I am author of a window manager (subtle) and embed ruby as scripting  
> language. Since the switch from  
> 1.8 to 1.9 I am facing many problems with asynchronous signals in  
> multithreading.
> 
> How is signal handling supposed to work and does the thread that ruby  
> creates automatically have any own  
> signal handlers? Due the asynchronous behaviour of signals like  
> SIGINT the first thread with a handler will get  
> the signal and this is sometimes not my main thread.
> 
> Also when this ruby thread has any handler, can some signals be  
> disabled or should I just add traps and rely  
> fully on ruby and dispatch the signals to my main thread?
> 
> Thanks in advance.
> 
> Wbr, Christoph
