Re: [NSTask] -launch return
Re: [NSTask] -launch return
- Subject: Re: [NSTask] -launch return
- From: Greg Guerin <email@hidden>
- Date: Tue, 9 Jun 2009 20:09:09 -0700
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@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