• 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: Help! program runs differently under debug than not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help! program runs differently under debug than not


  • Subject: Re: Help! program runs differently under debug than not
  • From: Greg Guerin <email@hidden>
  • Date: Wed, 21 Jun 2006 19:31:24 -0700

Rick Mann wrote:

>Yeah, it's more complicated than that. I basically have to do that in
>the child AND the parent, because the parent will time out in the
>time it takes me to do all that for the child. (Also, keep in mind
>that the child begins to execute on the return from fork(), not at
>main).

If the parent can time out, then it's operating in real-time.  But you
can't debug the child AND have the parent operate in real-time, because the
system as a whole (the pair of processes) is no longer operating in
real-time.

If you're going to debug the child, then you must also disable timeouts in
the parent.  Either BOTH processes operate in real-time (with timeouts), or
NEITHER do (for debugging).


It's about the same complexity to use Eric's sleep(1) approach after fork():

  static int foo = 0;
    ...
  pid_t pid = fork();  // 0 in child, pid in parent
  if ( pid == 0 )
  {
    while ( foo == 0 )
    {  sleep(1);  }
    ...go on to other child code...
  }
  else
    ...parent code...

There are other possible strategies, too, such as the signals
SIGSTOP/SIGCONT (see 'man signal'), but they may need more coordination.
Again, though, both processes have to operate in real-time or both have to
operate in non-real-time.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: CW to XCode conversion problem - template differences.
  • Next by Date: Shark Crisis
  • Previous by thread: Re: Help! program runs differently under debug than not
  • Next by thread: CW to XCode conversion problem - template differences.
  • Index(es):
    • Date
    • Thread