==>在我的应用程序中,我使用了三种不同的线程代码,其中所有线程都是同一类型==>我在appdelegate类中定义了两个线程==>根视图控制器中的一个==>所有线程具有不同的睡眠时间
==>in my application i have used three different thread code for one of them is here all thread are of same kind ==>i have defined two thread in appdelegate in the root view controller ==>all the thread having different sleep time
我的问题是,是否有任何线程会被另一个线程杀死,而一个线程的调用时间会受到另一个线程的影响?
-(void)PostData { NSAutoreleasePool *apool = [[NSAutoreleasePool alloc] init];// we are responsible for the memory pool while(TRUE) { [self performSelectorOnMainThread:@selector(PostAllthedata) withObject:nil waitUntilDone:YES]; [NSThread sleepForTimeInterval:150]; } [apool release]; } -(void)PostAllthedata { PostSyncData *objPostSyncData=[[PostSyncData alloc]init]; [objPostSyncData release]; }
从相同的线程导致相应的选择器排队和执行以相同的顺序打电话了.
Multiple calls to this method from the same thread cause the corresponding selectors to be queued and performed in the same same order in which the calls were made.
这篇关于一个线程会杀死iPhone应用程序中的另一个线程(两个线程都是主线程)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!