Is there an upper limit to stack size for secondary threads for iPhone?
In building an iPhone app, I created a secondary thread to handle real-time tasks.
Apple开发者_如何转开发 Developer documentation seems to indicates a "recommended/maximum" stack size of 512KB (524288 bytes) for secondary threads. http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html
Does anyone know if NSThread imposes an upper limit to stack sizes for secondary threads? (other than the obvious, "when you run out of stack+heap space, than that is the upper limit")
Apple documentation is unclear.
Below is a question about iPhone stacks, but does not address the issue. is there stack size in iphone?
I believe the documentation you link to is specifying the default stack sizes for particular kinds of threads, not the recommended or maximum stack sizes.
Stack size is the current size limit for the stack; you can't use more stack memory than is allowed by the stack size.
On the other hand, you can increase the stack size for particular threads: https://developer.apple.com/library/mac/qa/qa1419/_index.html
精彩评论