• 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: Thread usage : Main thread interrupting secondary thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread usage : Main thread interrupting secondary thread


  • Subject: Re: Thread usage : Main thread interrupting secondary thread
  • From: Miles <email@hidden>
  • Date: Thu, 5 Mar 2009 22:53:10 -0800

Sorry to bump this but it's driving me nuts. Even knowing if this sounds
expected or unexpected would be really helpful at this point, so I can
figure out where to go from here to solve this problem.
Thanks again, in advance.


On Thu, Mar 5, 2009 at 12:43 PM, Miles <email@hidden> wrote:

>
> I'm new to using threads and hitting an unexpected issue.
>
> *There is an object moving across the screen on a separate thread started
> like this:*
>
> [NSThread detachNewThreadSelector:@selector( startObjectsAnimation: )
> toTarget:animationHelper withObject:nil];
>
> * Then in animationHelper:*
>
> NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
> animationTimer = [NSTimer scheduledTimerWithTimeInterval:0.02 target:self
> selector:@selector(doAnimation: ) userInfo:nil repeats:YES];
> [[NSRunLoop currentRunLoop] addTimer:animationTimer
> forMode:NSDefaultRunLoopMode];
> [[NSRunLoop currentRunLoop] run];
> [autoreleasepool release];
>
>
> *Then I have another object that when touched, gets a fade animation
> applied to it (on the main thread):*
>
>     CAAnimationGroup *anim = [AnimationCreatorUtil
> createAnimationsForOnWayOut];
>     anim.delegate            = tv;
>     [[tv.mview layer] addAnimation:anim forKey:@"fade"];
>     [tv.mview setAlpha:0];
>
> This is happening on the main thread. However, when this fade animation is
> applied on the main thread, the animation of the other object on the
> secondary thread pauses for a really brief moment. Since they are happening
> on different threads I'd expect neither of them to affect one another. What
> could be causing this?
>
> Thanks!
>
_______________________________________________

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

  • Follow-Ups:
    • Re: Thread usage : Main thread interrupting secondary thread
      • From: Kyle Sluder <email@hidden>
References: 
 >Thread usage : Main thread interrupting secondary thread (From: Miles <email@hidden>)

  • Prev by Date: Re: NSTask - Notification and Threads
  • Next by Date: Re: Thread usage : Main thread interrupting secondary thread
  • Previous by thread: Thread usage : Main thread interrupting secondary thread
  • Next by thread: Re: Thread usage : Main thread interrupting secondary thread
  • Index(es):
    • Date
    • Thread