1

I'm working on a Rails 3 app (running on Phusion Passenger) that is spawning new threads in a method.

Will those threads live in the process that spawned them, or will Passenger create a new process for them to live in? They will live in shared memory space at that point, so any variable sets by Thread One will be seen by Thread Two, right?

mstrom
  • 1,655
  • 3
  • 26
  • 41

1 Answers1

1

Threads created by Thread.new live in the same process and can share variables.

By default Passenger creates new process for each request, but you can configure it to spawn threads if you have Enterprise version. Docs

About threads and forks

Sharing variables for rails

kolas
  • 754
  • 5
  • 16