fork() for long running calculations?

Hi,

I'm thinking of using fork() for long running calculations in some
code of mine, that's run via the Apache fcgid module. It's some heavy
calculation/db work that, however, doesn't need to send anything back
to the user. Are there any problems with this approach?

Thanks,
Dave

I'm thinking of using fork() for long running calculations in some
code of mine, that's run via the Apache fcgid module. It's some heavy
calculation/db work that, however, doesn't need to send anything back
to the user. Are there any problems with this approach?

Look into backgroundrb first... might work better for you...

http://backgroundrb.rubyforge.org/

fork() is a lot simpler. The only issue was if your process failed-
you end up with zombie processes that dont get cleaned up until
reboot. I use it though - make sure you exit gracefully.

though late to the thread, I would recommend activemessaging - just send a message to a queue, and it can be picked up and processed by another process (remote or local). Nice thing is you fire and forget - you don’t have to worry about who processes the message or where it gets processed.

http://code.google.com/p/activemessaging/

-A