Process.detach - not detaching child?

G

goodieboy

Hi,

I've got a script that was working great on OS X and now not working
on Fedora Core 6. Both are running Ruby 1.8.6 and the latest Rails.
The application is a Rails app that uses fork and the Process.detach.
On OS X, the process gets detached and all is well, but on Fedora I
the parent process hangs and waits for the child to finish.

I need to fork some code, and make sure it's detached from the parent
so there is no waiting. What's the best way to do this?

Matt
 
G

goodieboy

OK,

What I've found out is that is does indeed get detached from the
parent. The problem is, there is a lag time longer than I experienced
on another OS/environment. If I remove all of the code from the fork,
it's very quick. So it seems (obviously) that it starts running the
code in the fork block before it gets detached. The parent waits for
about 2-3 seconds (too long!) and then the forked process is detached.
The 2-3 seconds happens whenver the code block takes longer than that.
If it takes 10 seconds, the parent still takes 2-3 seconds to detach
the fork. How can I make that fork detach happen instantly? :) Is it
possible?

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top