Sunday, September 29, 2013

iphone multithreading problems, experts please enter.

Read the iphone develop multithreaded the information, I understand that: the newly opened threads (such as using NSOPERATION) data can only wait for the end of the thread to another thread. Unlike WINDOWS, I open a thread with a while (1) statement, you can make a new thread always exist. The data can be a new thread of communication between threads spread out. Is my understanding correct?
If my understanding is correct, and now my iphone client program, you need to listen for tcp connection, at any time from the server receives the data sent, how to achieve this? Please expert guidance, thank you!
Reply:
Is wrong. NSOperator just NSThread above package a bit. If you want to use, such as windows on the thread, then you can use NSThread.

TCP listening links, reference socket c / s mode. Internet search vessels, many related to the introduction.
Reply:
ls on the right, with nsthread on it. . .
Reply:
First of all thank two of cheer. I read the following technical documents: http://developer.apple.com/library/ios/ # technotes/tn2109/_index.html # / / apple_ref/doc/uid/DTS40010274
Which was about NSThread unsafe. Before considering the use NSOPERATION. If you have experienced that NSTHREAD, I can also use NSTHREAD. NSTHREAD where you can add while (1) such cycles do? How to pass data out of it. Also want to enlighten me more carefully. Thank you!

No comments:

Post a Comment