Plans for Kernel.fork?

Hello,

I have no need for Kernel.fork personnaly right now, but I’m wondering
because some code I use (Resque workers) optionally rely on fork if it’s
supported, so I may tweak it more if Kernel.fork is planned.

What is the trend: is Kernel.fork not planned for implementation at all,
or
is it temporary ?

thanks!

– Thibaut

Unfortunately, fork is not something that is really possible with the
JVM* <---- note the asterisk :slight_smile:

-Tom

    • Actually we do have a flag for turning on fork, but largely it
      does not work. The fork() call when called only forks the current
      executing thread, but does not replicate anything else neccesary for a
      forked copy of the JVM to keep running (for example, things like the
      garbage collector). Because of this I doubt we will ever see a
      reasonable fork for the JVM.

PS- Another wrinkle in fork is that it does not work on windows. You
may or may not care about this…
PPS- If you just want the fork/exec pattern you should consider
Charlie’s spoon gem. It uses ffi and spawn and is portable across MRI

  • JRuby.

On Mon, Mar 1, 2010 at 9:34 AM, Thibaut Barrère
[email protected] wrote:

– Thibaut


blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Thomas,

thanks for the detailed explanation. Actually I don’t need to use fork,
I
was just trying to understand if fork was likely to be supported later
on
(to see if some code needs reworking or not)

Thanks!

– Thibaut

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs