1 # -*- encoding: binary -*-
5 # Actor concurrency model for Rubinius. We can't seem to get message
6 # passing working right, so we're throwing a Mutex into the mix for
7 # now. Hopefully somebody can fix things for us. Currently, this is
8 # exactly the same as the ThreadSpawn model since we don't use the
9 # message passing capabilities of the Actor model (and even then
10 # it wouldn't really make sense since Actors in Rubinius are just
11 # Threads underneath and our ThreadSpawn model is one layer of
14 # This is different from the Revactor one which is not prone to race
15 # conditions within the same process at all (since it uses Fibers).
16 module Rainbows::ActorSpawn
17 include Rainbows::ThreadSpawn
19 # runs inside each forked worker, this sits around and waits
20 # for connections and doesn't die until the parent dies (or is
21 # given a INT, QUIT, or TERM signal)
22 def worker_loop(worker) # :nodoc:
23 Rainbows::Const::RACK_DEFAULTS["rack.multithread"] = true # :(
24 init_worker_process(worker)