• 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: Scheduling a selector when a thread completes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheduling a selector when a thread completes


  • Subject: Re: Scheduling a selector when a thread completes
  • From: Michael Ash <email@hidden>
  • Date: Fri, 1 May 2009 00:54:02 -0400

On Thu, Apr 30, 2009 at 3:31 PM, Ken Tozier <email@hidden> wrote:
>
> On Apr 29, 2009, at 11:48 PM, Michael Ash wrote:
>
>> Seems like you're adding a lot of complication for what is essentially
>> a continually running operation. Instead of that, why not do this?
>>
>> 1. Spawn a thread.
>> 2. Sample files.
>> 3. Sleep.
>> 4. Goto 2.
>>
>> Or, in code:
>>
>> - (void)threadMethod {
>>   while(1) {
>>       [self sampleFiles];
>>       sleep(5);
>>   }
>> }
>
> That looked very promising, but when I tried it, it locks up the app during
> launch. It enters the thread but blocks the folder scanner from calling my
> console view's KCLogMessage function.

So fix your code. There's nothing wrong with the approach. If your
code is freezing, debug it and make it not freeze.

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: 
 >Scheduling a selector when a thread completes (From: email@hidden)
 >Re: Scheduling a selector when a thread completes (From: Michael Ash <email@hidden>)
 >Re: Scheduling a selector when a thread completes (From: Ken Tozier <email@hidden>)

  • Prev by Date: Threadsafe function help
  • Next by Date: Re: Writable dir for non-admin user outside user's dir
  • Previous by thread: Re: Scheduling a selector when a thread completes
  • Next by thread: Re: Scheduling a selector when a thread completes
  • Index(es):
    • Date
    • Thread