同步-异步,
阻塞-非阻塞,thread的状态,等待还是不等待
并发-锁、死锁,同时发生
[size=medium]Threading Programming Guide [/size]
[url]http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1[/url]
RunLoop号称是基础消息机制,看了下模型是个消息队列,用于同步消息。
NSRunLoop对象接口也比较少,理清下面几这个这就够了。
[url]http://www.cocoachina.com/bbs/simple/?t43852.html[/url]
[size=medium]一些相关类与概念
NSThread (基层)
NSOperation(对NSThread封装) 与 NSOperationQueue
NSTimer
NSRunloop
CADisplayLink
主线程 performSelectorOnMainThread
NSOperation:[url]http://bj007.blog.51cto.com/1701577/411181[/url]
NSTimer:[url]http://mobile.51cto.com/iphone-282221.htm[/url]
Run Loop:[url]http://blog.csdn.net/nerohoop/article/details/7214662[/url]
CADisplayLink:[url]http://blog.sina.com.cn/s/blog_68237cd10100yptj.html[/url]
[/size]
[size=large]
NSInvocation
NSInvocationOperation
NSBlockOperation
[url]http://www.dev3g.com/?p=36[/url]
[url]http://blog.csdn.net/freshforiphone/article/details/7381329[/url]
[url]http://hi.baidu.com/zhulin014/blog/item/a9ec6d1288041638dd5401ae.html[/url]
[/size]
[url]http://blog.csdn.net/favormm/archive/2010/01/27/5262708.aspx[/url]
[size=medium]Sending Messages[/size]
阻塞-非阻塞,thread的状态,等待还是不等待
并发-锁、死锁,同时发生
[size=medium]Threading Programming Guide [/size]
[url]http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/Introduction/Introduction.html#//apple_ref/doc/uid/10000057i-CH1-SW1[/url]
RunLoop号称是基础消息机制,看了下模型是个消息队列,用于同步消息。
NSRunLoop对象接口也比较少,理清下面几这个这就够了。
+ (NSRunLoop *)currentRunLoop;
+ (NSRunLoop *)mainRunLoop NS_AVAILABLE(10_5, 2_0);
- (void)addTimer:(NSTimer *)timer forMode:(NSString *)mode;
- (void)addPort:(NSPort *)aPort forMode:(NSString *)mode;
- (void)removePort:(NSPort *)aPort forMode:(NSString *)mode;
- (void)run;
- (void)runUntilDate:(NSDate *)limitDate;
- (BOOL)runMode:(NSString *)mode beforeDate:(NSDate *)limitDate;
还有那坨performSelector
//run loop 是非阻塞的,其它是阻塞的,oh~
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:3]];
sleep(3);
[NSThread sleepUntilDate:[NSDate distantPast]];
[url]http://www.cocoachina.com/bbs/simple/?t43852.html[/url]
[size=medium]一些相关类与概念
NSThread (基层)
NSOperation(对NSThread封装) 与 NSOperationQueue
NSTimer
NSRunloop
CADisplayLink
主线程 performSelectorOnMainThread
NSOperation:[url]http://bj007.blog.51cto.com/1701577/411181[/url]
NSTimer:[url]http://mobile.51cto.com/iphone-282221.htm[/url]
Run Loop:[url]http://blog.csdn.net/nerohoop/article/details/7214662[/url]
CADisplayLink:[url]http://blog.sina.com.cn/s/blog_68237cd10100yptj.html[/url]
[/size]
[size=large]
NSInvocation
NSInvocationOperation
NSBlockOperation
[url]http://www.dev3g.com/?p=36[/url]
[url]http://blog.csdn.net/freshforiphone/article/details/7381329[/url]
[url]http://hi.baidu.com/zhulin014/blog/item/a9ec6d1288041638dd5401ae.html[/url]
[/size]
// NSLock : NSObject <NSLocking>
// NSCondition : NSObject <NSLocking>对象锁
// NSConditionLock : NSObject <NSLocking>条件锁NSConditionLock,
// NSRecursiveLock : NSObject <NSLocking>循环锁NSRecursiveLock,
[url]http://blog.csdn.net/favormm/archive/2010/01/27/5262708.aspx[/url]
[size=medium]Sending Messages[/size]
– performSelector:withObject:afterDelay:
– performSelector:withObject:afterDelay:inModes:
– performSelectorOnMainThread:withObject:waitUntilDone:
– performSelectorOnMainThread:withObject:waitUntilDone:modes:
– performSelector:onThread:withObject:waitUntilDone:
– performSelector:onThread:withObject:waitUntilDone:modes:
– performSelectorInBackground:withObject:
+ cancelPreviousPerformRequestsWithTarget:
+ cancelPreviousPerformRequestsWithTarget:selector:object:
@end