Problem killing my threads :)
Problem killing my threads :)
- Subject: Problem killing my threads :)
- From: Dylan Neild <email@hidden>
- Date: Mon, 23 Sep 2002 00:57:38 -0400
Hi Everyone,
Another threading related question. I have an application that I'm
building, and as it stands, a particular module gets instantiated and
in turn, spawns a couple of threads.
What I want to know is, how do I go about terminating these threads,
regardless of what they're up to? One of them, at least, does some very
deep recursion, and I'd like to be able to terminate it from another
thread (the primary application thread, specifically), whenever I like.
So:
1. My application launches in thread 0.
2. My application, as part of it's startup procedure, launches threads
1 and 2.
3. The user clicks a RESTART BACKGROUND button. The application should
go now and address both threads 1 and 2 and ask them to stop running.
Effectively, thread 0 is now terminating it's own threads 1 and 2.
4. Once it's sure they are done and they're resources have been cleaned
up, thread 0 goes and launches two new threads, which due to the
destruction of the original 1 and 2, are _also_ now 1 and 2 (just newer
instances).
Any thoughts? I suppose I could so this using the standard BSD pthreads
calls, but I really don't want to venture outside of what Cocoa
considers to be acceptable. I know that spawing a pthread directly,
rather then using NSThread has undesirable side effects, but what about
_terminating_ threads with pthreads calls?
Thanks in advance,
Dylan
_______________________________________________
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.