Add build-time option to run the emulator in a thread instead of libco
Currently, the emulator is wrapped with libco. This has some negative implications for debugging. Possibly other issues as well when it comes to the emulator doing system calls, or when saving/restoring registers on modern CPUs when switching context.
This adds a build-time makefile flag (USE_LIBCO
) to libco with a pthreads-based mechanism. By default it's set to 1. Setting it to 0 will use pthreads.
I did observe a performance decrease however compared to libco. It's a bit difficult to measure exactly due to FPS fluctuation when using RA's fast-forward feature, but it seems to be around 3% to 5% or so.