Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You almost certainly don't want to write assembly instructions to perform the stack manipulation. iOS is already on its third version of the ARM instruction set, having transitioned from ARMv6 through ARMv7 to ARMv7s. As of the iPhone 5, Apple has further added the artificial barrier that you may not submit an application with an ARMv6 fork that also supports the full iPhone 5 screen. I'm sure Apple's motivation is to ensure it can transition to processors without an ARMv6 compatibility mode at some point in the future but for us developers it obviously means not becoming too dependent on the specific instruction set.</p> <p>That leaves threads. iOS has a full set of well-developed threading mechanisms and pthread is there to expose the relevant subset. Grand Central Dispatch tends to be the normal solution used now to ensure that different tasks can occur simultaneously so swallows most of the Internet documentation but the lower-level solutions remain.</p> <p>Obvious trivial example, using an <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSConditionLock_Class/Reference/Reference.html" rel="nofollow">NSConditionLock</a>:</p> <pre><code>- (void)methodOnThread1 { while(1) { [conditionLock lockWhenCondition:kMoreInputAvailable]; // process whatever is currently in the common access pool [conditionLock unlockWithCondition:kWaitingForInput]; } } - (void)methodOnThread2 { while(1) { // do whatever is necessary to produce more input, // creating it locally and taking as long as it takes [conditionLock lockWhenCondition:kWaitingForInput]; // push input to common access pool, by whatever means [conditionLock unlockWithCondition:kMoreInputAvailable]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload