2、的使用越简单,也是Apple最推荐使用的。这篇我们主要介绍和使用NSThread,后面会继续2、3的讲解和使用。1.2三种方式的有缺点介绍:NSThread:优点:NSThread比其他两个轻量级缺点:需要自己管理线程的生命周期,线程同步。线程同步对数据的加锁会有一定的系统开销NSThread实现的技术有下面三种:TechnologyDescriptionCocoathreadsCocoaimplementsthreadsusingthe NSThread class.Cocoaalsoprovidesmethodson NSObject fors
3、pawningnewthreadsandexecutingcodeonalready-runningthreads.Formoreinformation,see “UsingNSThread” and “UsingNSObjecttoSpawnaThread.”POSIXthreadsPOSIXthreadsprovideaC-basedinterfaceforcreatingthreads.IfyouarenotwritingaCocoaapplication,thisisthebestchoiceforcreatingthreads.ThePO