I am porting a C++ project to iOS for use on iPhone and iPad. This project uses the Boost.Coroutine library extensively. Boost.Coroutine does not have an implementation for the iPhone's ARMv6/ARMv7 instruction set.
Are there other coroutine libraries that can run on iOS?
If not, is it possible to write coroutine behavior on ARM? I can see a few potential ways to do this:
- Write assembly instructions directly to perform the stack manipulation. I am not very well versed in assembly, and I'm worried that the ARM architecture may not include the instructions necessary to copy & paste the stack, or to manually move the stack pointer.
- Write coroutines using something similar to pthreads, or Win32 fibers. I'm not sure if there's something like this that could be used on iOS.
- Implement coroutines, perhaps even Boost.Coroutine itself, on top of threads. This seems the most likely to work, but would definitely have performance drawbacks.
Note: Unity supports coroutines in C# on iOS; I'm not sure if this is limited to a smaller subset of typical coroutine behavior. If not, does this mean Unity has a solution?