As I mentioned, in the case of same-architecture launches, everything works.

In the case of Intel launching PPC, -launch returns immediately and -isRunning 
says it's running (if I step over in the debugger for example). However, in 
reality in the case of Intel launching PPC, as I mentioned, there is about a 
2-3 second delay before my child binary runs - because of the Rosetta startup 
delay. -isRunning shouldn't say it's running when Rosetta hasn't even finished 
launching, let alone my PPC child within it.

I need to do this because when my method returns, a timer is immediately 
started which monitors the pid - and if the pid goes away or isn't present, it 
takes some action which I don't want to have happen.

It seems that -isRunning doesn't correctly report when the actual binary is 
running - only when Rosetta has *started*.

If the routine exits (because -isRunning == YES) when my child, is, in fact not 
yet running, then my main app controller makes an erroneous decision and takes 
some action it shouldn't.

In other words, I have to wait for the child to start before I can allow that 
method to execute or else my timer runs before the child has started.

It appears after reboot, Rosetta isn't running until an actual PPC binary is 
launched - which then causes the startup delay. I know this is the case because 
it only happens on first launch after reboot - after that Rosetta is already 
running and the problem never happens because there is no delay in launching 
the child.

Erg




________________________________
From: Michael Ash <[email protected]>
To: cocoa-dev <[email protected]>
Sent: Tuesday, June 9, 2009 5:47:48 PM
Subject: Re: [NSTask] -launch return

On Tue, Jun 9, 2009 at 6:55 PM, Erg Consultant<[email protected]> 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.
>
> In the Intel-launching-Intel or PPC-launching-PPC case, there is never any 
> problem whatsoever. Maybe I need to add some code to complete *after* Rosetta 
> has *finished* launching.

Can you elaborate on what the difference is, or what you think it is,
between Rosetta starting and your child starting, how that affects
your application, and why you need to know it?

When you do [task launch], the subprocess is running. It make take
some time to start and get to whatever state you're interested in, but
it *is* running. What is your purpose in trying to wait for the child
to "actually start", and how is that different from it starting in the
normal way?

Mike
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/erg_consultant%40yahoo.com

This email sent to [email protected]



      
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to