I find it absolutely appalling on a modern OS that I should have to write a 3rd 
PPC process and launch it just to get the API to behave as documented.

Erg




________________________________
From: Greg Guerin <[email protected]>
To: list-cocoa-dev <[email protected]>
Sent: Tuesday, June 9, 2009 8:09:09 PM
Subject: Re: [NSTask] -launch return

Erg Consultant wrote:

> 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.

Launch a dummy child process that only contains ppc code, then wait for that 
process to exit.  The dummy simply does exit(0).  This ensures that Rosetta is 
running if it's on an Intel CPU, or it will have simply burned a fork/exec on a 
PPC CPU.  Either way, you should then be able to launch further executables 
with little or no delay.  "Priming the pump", so to speak.

You may not even need to write any dummy code on 10.5+.  The /usr/bin/arch 
command can select a specific architecture (ppc in this case), and the 
/usr/bin/true command already performs an exit(0).  E.g.:

  /usr/bin/arch -ppc /usr/bin/true

There may be other ways to improve this beyond BF&I, such as testing the 
non-dummy executable before launching it, to see whether it even needs the 
dummy to load Rosetta first.

  -- GG

_______________________________________________

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