Re: [NSTask] -launch return
Re: [NSTask] -launch return
- Subject: Re: [NSTask] -launch return
- From: Erg Consultant <email@hidden>
- Date: Tue, 9 Jun 2009 19:12:09 -0700 (PDT)
The Rosetta startup delay is significant because my PPC-only child can't run until Rosetta is running - and it appears to not be running until the 1st PPC program since reboot has been run.
The child's pid does not change - but it appears the child does not run at all until Rosetta has finished launching - even thought isRunning says my PPC-only child has been launched.
The problem that I am trying to solve is that this particular method cannot exit until 1) I know the child is running, 2) the child has a valid pid that I can get via -processIdentifier.
I am trying to delay until the child is running and has a valid pid. If I run the exact same code a second time by quitting everything and running it again - everything works (becaus Rosetta is already running). If I reboot, the problem comes back because Rosetta is not running after reboot.
One more thing I failed to mention: I don't own the code for the child process - ever. It has to work with arbitrary compiled-only binaries that I didn't write.
Erg
________________________________
From: Greg Guerin <email@hidden>
To: list-cocoa-dev <email@hidden>
Sent: Tuesday, June 9, 2009 6:05:34 PM
Subject: Re: [NSTask] -launch return
Erg Consultant wrote:
> I forgot to mention that the problem case is exceptional: the problem I have is only in the case of an Intel version of the app trying to launch a PPC-only child the first time after reboot: -launch returns immediately, and isRunning returns YES, but there is like a 3 second delay between the time Rosetta begins to run and my binary is actually launched - it appears that isRunning returns YES as soon as Rosetta is started - not when my PPC child is actually started.
Why is Rosetta's startup delay significant? Does the child process ID change as a consequence?
If the startup delay were being caused by a slow disk, the child process might be similarly delayed in reaching its main() entry point, but that doesn't mean the child process doesn't have a valid pid.
Exactly what problem are you trying to solve?
Are you trying to delay until the child process has reached a certain point in its execution?
If so, then you should write the child process so it signals upon reaching a certain point in its execution. There are various ways to do that, including Posix semaphores, sentinel files in the file-system, shared memory, simple pipes, or traditional Posix signals.
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden