• 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: Killing child tasks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killing child tasks


  • Subject: Re: Killing child tasks
  • From: email@hidden
  • Date: Wed, 5 Jun 2002 15:22:52 -0400

I'm pretty sure it's SIGINT.

Owen Anderson

On Wednesday, June 5, 2002, at 03:14 PM, Phillip Morelock wrote:

On 6/5/02 4:07 AM, "Will Thimbleby" <email@hidden> wrote:

Hi,

I am using NSTasks to access other programs through standard
input/output. This all works, however if the user force-quits my
program, the tasks continue to run, unnoticed in the background using
processor power. Is there a way to ensure the child tasks are attached
to the main program so that when it exits the child tasks are forced to
exit as well.

<newbie who knows unix but not cocoa who probably shouldn't be giving
advice>
I am not sure if you can do this in a Cocoa program, but you can register a
signal handler (Unix-style, baby) for Unix apps and when the OS sends a kill
signal you will be able to run a routine. (Sort of like an interrupt
handler). see man kill and man sigaction for more information. Although I
don't know what signal gets sent when the cmd-opt-esc kill is used. Anyone?

I would keep a linked list of all the processes you've started, or something
like that...then you can just iterate the list and kill if necessary.

Also: Is there an easy way to get them to run as nice, so that other
programs still have priority.

Probably --- I don't know NSTask but do you feed it a command string? Does
it get interpreted as a sh / tcsh expression? If so this shouldn't be too
hard. see man renice and man nice

Cheers

Will

fillup

_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Killing child tasks (From: Phillip Morelock <email@hidden>)

  • Prev by Date: Re: Thread safe programming
  • Next by Date: Maintaining open source UNIX source code and builds in a Project Builder project...
  • Previous by thread: Re: Killing child tasks
  • Next by thread: Re: Killing child tasks
  • Index(es):
    • Date
    • Thread