https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112014-01-02T15:53:30ZRuby Issue Tracking SystemRuby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=440172014-01-02T15:53:30Zjsc (Justin Collins)
<ul><li><strong>File</strong> <a href="/attachments/4139">0002-Wake-waiting-threads-when-SizedQueue-clear-is-called-2.0.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4139/0002-Wake-waiting-threads-when-SizedQueue-clear-is-called-2.0.patch">0002-Wake-waiting-threads-when-SizedQueue-clear-is-called-2.0.patch</a> added</li></ul><p>Looks like this is also a problem in 2.0.0, although the implementation is a little different. Attaching patch for 2.0.0 too although it's probably clear.</p> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=440182014-01-02T16:23:17Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>I agree this is a problem. This also affects 2.1.0 and trunk (where<br>
SizedQueue is C).</p> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=441072014-01-06T15:31:12Zko1 (Koichi Sasada)
<ul><li><strong>Category</strong> set to <i>ext</i></li><li><strong>Assignee</strong> set to <i>ko1 (Koichi Sasada)</i></li><li><strong>Target version</strong> set to <i>2.2.0</i></li></ul> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=442942014-01-14T12:14:57ZAnonymous
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r44595.</p>
<hr>
<ul>
<li>
<p>ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERS<br>
on SizedQueue#clear. <a href="/issues/9342">[ruby-core:59462]</a> [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3 (Closed)" href="https://redmine.ruby-lang.org/issues/9342">#9342</a>]</p>
</li>
<li>
<p>test/thread/test_queue.rb: add test. the patch is from<br>
Justin Collins.</p>
</li>
</ul> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=444032014-01-18T03:30:09Zjsc (Justin Collins)
<ul></ul><p>Thank you!</p>
<p>As far as I can tell, SizedQueue#clear has never notified waiting threads since it was introduced in Ruby 1.4. Perhaps something with green threads allowed it to work anyway? It is definitely an issue in 1.9.3 and later.</p> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=449402014-02-05T03:07:35Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN</i> to <i>1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED</i></li></ul> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=450652014-02-09T16:10:38Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED</i> to <i>1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED</i></li></ul><p>1.9.3 and 2.0.0 has different implementation of Queue/SizedQueue from 2.1/trunk.<br>
I partially backported r44595 for test, and commited a patch for ruby_2_0_0 at r44899.</p> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=451132014-02-14T03:49:21Zusa (Usaku NAKAMURA)usa@garbagecollect.jp
<ul><li><strong>Backport</strong> changed from <i>1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED</i> to <i>1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED</i></li></ul><p>Commited to ruby_1_9_3 at r44932.<br>
Thank you, Justin!</p> Ruby master - Bug #9342: [PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3https://redmine.ruby-lang.org/issues/9342?journal_id=453672014-02-22T04:21:50Znaruse (Yui NARUSE)naruse@airemix.jp
<ul><li><strong>Backport</strong> changed from <i>1.9.3: DONE, 2.0.0: DONE, 2.1: REQUIRED</i> to <i>1.9.3: DONE, 2.0.0: DONE, 2.1: DONE</i></li></ul><p>r45104.</p>