What's new

What the fork?

Lig

New member
There is mention in the api of being able to do things while a game is running. Is this accomplished by forking or making a new thread that runs the M64CMD_EXECUTE command and having the parent process run cheats and other command? Because once my gui program hits the line where it runs the M64CMD_EXECUTE command it doesn't pass past that point until the game has exited or at least it appears that way I haven't run it with a breakpoint and debug or anything like that.
 

Richard42

Emulator Developer
The way that I intended this to work is that the front-end should create a thread which calls the M64CMD_EXECUTE command to start the emulator running and returns when finished. The main thread is free to continue accepting user input and making calls into the core as necessary. I would recommend using the SDL threading functions since everything else uses SDL but it shouldn't be an absolute requirement.

There are probably lots of threading bugs lurking since this hasn't been thoroughly tested. However the underlying code works exactly the same as it used to with the old GUIs (a thread was also created in the old architecture) and none of that was formally thread-safe but it mostly worked, so it should still mostly work. As we find bugs I'll add mutexes as necessary to make it more bulletproof.
 
OP
L

Lig

New member
Oh ok. So I'm going to go were no ui has [recently] gone before.

ps. Thats a NASA reference not the Star Trek one

pss. Okay its a Star Trek reference, but I just like the next generation I'm not a trekkie.
 

Top