• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [NSTask] -launch return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSTask] -launch return


  • Subject: Re: [NSTask] -launch return
  • From: Michael Ash <email@hidden>
  • Date: Wed, 10 Jun 2009 02:59:16 -0400

On Tue, Jun 9, 2009 at 11:12 PM, Erg Consultant<email@hidden> wrote:
> I later monitor the pid that I squirreled away from within a periodic timer:
>
> err = GetProcessForPID( pid, &psn );
>
> If GetProcessForPID returns an error, I know the process is not running.

No you don't.

If GetProcessForPID returns an error, you know the process is not
running OR has not checked in with the window server yet.

A process can take an arbitrary amount of time to check in with the
window server. If this is your problem with Rosetta, then it's simply
exposing a bug in your code. You need to fix it to handle the case
where GetProcessForPID returns an error for a process that is alive.
This can and will happen. If you want to see if the process is
running, check for its existence directly (like with [task isRunning])
not by seeing if it has a PSN. Many processes do not have PSNs,
including every process you launch with NSTask until they check in
with the window server, if they ever do.

Mike
_______________________________________________

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

References: 
 >Re: [NSTask] -launch return (From: Scott Ribe <email@hidden>)
 >Re: [NSTask] -launch return (From: Erg Consultant <email@hidden>)

  • Prev by Date: Re: [NSTask] -launch return
  • Next by Date: Re: nsdocument application hang ...
  • Previous by thread: Re: [NSTask] -launch return
  • Next by thread: Re: [NSTask] -launch return
  • Index(es):
    • Date
    • Thread