tarcieri/celluloid — Issue #14: Sometimes actor crashes for no apparent reason
Author: ckigundu
Created: 2011-11-29 14:13:23+00:00
State: open

Hello,

I am brand new to ruby and celluloid

I have an error with celluloid ; Please see below snipplet:

My error results from the value assigned to runners

1. For runners < 1000 all is well
2. For runners 2000-5000 I sometimes get

Celluloid:DeadActorError: attempted to call a dead actor

3. For runners >10000

FibreError: dead fiber called
Error: unable to create new native thread

The error that intrigues me more is error 2, why should the actor die ? Have I hit the limits ?

Error 3, I suspect I cant do much about possibly a java thing.

Please advise !
----
require 'celluloid'

runners=100000

class Rema
include Celluloid

def initialize
@num = 0
end

def fix
@num +=1
end

def values
puts " got #{@num}"
end
end

hex = Rema.new

thing=[]

0.upto(runners){ |x|

q= Thread.new {
hex.fix!
}

thing << q

}
thing.each { |x| x.join}

hex.values