
Am 06.02.2011 15:14, schrieb Daniel Larimer:
I have put some code up on github that uses libtask's implementation of asm based context switching as a backend implementation of boost::context. I have verified that it allows me to use Boost.Fiber on Mac OS X. I suspect that my changes would allow Boost.Context to work with arm, power pc, and any other platform supported by libtask.
The protected_stack allocator does not seem to work on OS X, so I switched to using malloc/free. I wonder if this is the reason why the ucontext implementation was not working on OS X either. Considering ucontext on Mac OS X is deprecated and asm 100x faster, I am not sure it is worth while to get the ucontext implementation working.
I suspect that the correct solution would be to modify the code in libs/context/src/libtask to implement the fcontext pattern, but I have no experience with asm.
https://github.com/bytemaster/boost_context_osx/tree/master/libs/context/src
Mac OS X uses the SYSV ABI - the problem is the MACH-O binary format which I've to address if the lib is build upon PIC. Do you test on i386 or x86_64? Oliver