[#11439] comments needed for Random class — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/06/12

[#11450] Re: new method dispatch rule (matz' proposal) — David Flanagan <david@...>

This is a late response to the very long thread that started back in

17 messages 2007/06/13

[#11482] Ruby Changes Its Mind About Non-Word Characters — James Edward Gray II <james@...>

Does this look like a bug to anyone else?

10 messages 2007/06/16

[#11505] Question about the patchlevel release cycle — Sylvain Joyeux <sylvain.joyeux@...4x.org>

1.8.6 thread support was broken in bad ways. It stayed for three months

20 messages 2007/06/20
[#11512] Re: Question about the patchlevel release cycle — Urabe Shyouhei <shyouhei@...> 2007/06/20

Hi, I'm the 1.8.6 branch manager.

[#11543] Re: Apple reportedly to ship with ruby 1.8.6-p36 unless informed what to patch — James Edward Gray II <james@...>

On Jun 27, 2007, at 4:47 PM, Bill Kelly wrote:

10 messages 2007/06/27

Re: Question about the patchlevel release cycle

From: Nobuyoshi Nakada <nobu@...>
Date: 2007-06-20 08:08:03 UTC
List: ruby-core #11510
Hi,

At Wed, 20 Jun 2007 16:11:35 +0900,
Sylvain Joyeux wrote in [ruby-core:11509]:
> > could you refer to bug #s?
> 
> > > 1.8.6 thread support was broken in bad ways. It stayed for three
> > > months
>   unfortunately, I don't find the bugreport. It has been discussed first on 
>   ruby-core and then opened (as far as I remember)
>   See ruby-core:10594

And the next report is [ruby-dev:30653], which the following
code dumps core.

-----lb.rb------
require 'thread'

class LocalBarrier
  def initialize(n)
    @wait = Queue.new
    @done = Queue.new
    @keeper = begin_keeper(n)
  end

  def sync
    @done.push(true)
    @wait.pop
  end

  def join
    @keeper.join
  end

  private
  def begin_keeper(n)
    Thread.start do
      n.times do
        @done.pop
      end
      n.times do
        @wait.push(true)
      end
    end
  end
end

n = 10

lb = LocalBarrier.new(n)

(n - 1).times do |i|
  Thread.start do
    sleep(rand(n) + 1)
    puts "#{i}: done"
    lb.sync
    puts "#{i}: cont"
  end
end

lb.sync
puts "#{n-1}: done"

puts "exit."
----------------

-- 
Nobu Nakada

In This Thread