Re: Pausing and terminating a thread
Re: Pausing and terminating a thread
- Subject: Re: Pausing and terminating a thread
- From: Ben Haller <email@hidden>
- Date: Tue, 30 Aug 2005 17:48:30 -0700
On Aug 30, 2005, at 5:22 PM, Ryan Britton wrote:
Here's an approach I used when implementing something similar to
Finder's spotlight search window. Hopefully it should give you
some idea of how I did this.
Right; if I understand your code correctly, though, you are
polling the "stopThread" ivar every time through your loop. If your
loop took very little time to complete one iteration, that polling
would end up taking a substantial amount of the total time taken by
the thread. The only solution to that (as far as anybody on the list
so far seems to know) is unrolling the loop so that you only have to
check the flag every x iterations. That's the problem.
Nevertheless, the code is a nice illustration of what is
apparently the best way to do this sort of thing, given current
APIs. I don't mean to jump on you at all. Thanks for posting it.
Ben Haller
Stick Software
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden