running the core in a separate thread?

Developers
2010-05-14
2013-04-22
  • Wei Mingzhi
    Wei Mingzhi
    2010-05-14

    Hi,

    Currently PCSX-df just calls SysRunGui() inside the core to restart the GUI when user pressed ESC in game. This may cause memory (call stack) leaks, which is definately not good.

    There are 2 ways I can think about to solve this without refactoring everything in the core:
    1) use try/catch/throw in C++
    2) running the emu core in a separate thread, and just terminate the thread when user presses ESC (similar thing is done in macosx port I think)

    as 1) requires additional dependency (libstdc++) I would prefer 2) instead. Also, running in a separate thing would also allow us doing something cool (such as keeping the GUI when emulation is running) in the future I think

    Just some random thought :)

    btw, as the gui code migration is not done yet (and not likely in a short time) and there are still something seriously broken with adbutron's change in plugins (specially with the config file), I think it would be better to keep PCSX-r Project alive for the time being. Of course, I'll periodly sync the changes :)

     
  • Andrew Burton
    Andrew Burton
    2010-05-17

    2) sounds better, and there should be glib options to manage these threads. Not sure I know how to implement it from a makefile/core perspective, though!

    The code migration should be done - the main changes from pcsxr is that the plugin .so is not symlinked to the local dir.

    This means that the plugin must look to $HOME/.config/pcsx/plugins to pick up their settings, which most of them do in psemu-plugins, and it looks like that has been migrated into the SVN version of pcsx-df - thanks!

    This should fix the problems you've been having - let me know if not.