https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-12-21T21:20:19ZRuby Issue Tracking SystemRuby master - Bug #7474: I am getting undefined symbol: rb_enable_interrupt when running event machinehttps://bugs.ruby-lang.org/issues/7474?journal_id=349372012-12-21T21:20:19Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Category</strong> set to <i>core</i></li><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>kosaki (Motohiro KOSAKI)</i></li></ul><p>It's been static since r32510.<br>
I'm not sure if it is a part of public API.</p> Ruby master - Bug #7474: I am getting undefined symbol: rb_enable_interrupt when running event machinehttps://bugs.ruby-lang.org/issues/7474?journal_id=349892012-12-22T01:14:41Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Feedback</i></li></ul><blockquote>
<p>It's been static since r32510.<br>
I'm not sure if it is a part of public API.</p>
</blockquote>
<p>vm_core.h is definitely internal api place.<br>
Moreover rb_disable_interrupt() is wrong api and we may be removed later.<br>
There are two problems:</p>
<ol>
<li>
</ol>
<p>rb_disable_interrupt()<br>
..<br>
rb_enable_interrupt()</p>
<p>is expand to</p>
<pre><code>sigfillset(&mask);
pthread_sigmask(SIG_SETMASK, &mask, NULL);
</code></pre>
<p>...</p>
<pre><code>sigemptyset(&mask);
pthread_sigmask(SIG_SETMASK, &mask, NULL);
</code></pre>
<p>See? rb_enable_interrupt() ignore old sigmask and set signal mask to empty.</p>
<ol start="2">
<li>thread unsafe</li>
</ol>
<p>pthread_sigmask() only change current thread sigmask. then other thread still be able to<br>
be interrupted by signal. then, this api only work single thread context. MRI only use this<br>
api when process creation time.</p>
<p>So, I have a question. Why do event machine need rb_disable_interrupt()? If I understand correctly,<br>
event machine don't have single thread guarantee.</p> Ruby master - Bug #7474: I am getting undefined symbol: rb_enable_interrupt when running event machinehttps://bugs.ruby-lang.org/issues/7474?journal_id=357072013-01-30T06:30:46Zkosaki (Motohiro KOSAKI)kosaki.motohiro@gmail.com
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Rejected</i></li></ul><p>No response. I'll close this then.</p>