Support for multi threading cores#75
Conversation
|
Are there any ways to test against this change, like with a precompiled core somewhere? |
|
Its hard to test because the environment needs to be cross origin isolated. I did however test it in Foxol with some cores i compiled. What would be a good strategy here? |
|
It's ok to not add an automated test case right now. But it's better to have a button in the playground for manually testing, so we can make sure it's actually working. import { defineConfig } from 'vite'
export default defineConfig({
server: {
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
},
})The problem is where would the test threaded cores come from. Are your cores open for test usage here? Or are there any existing cores on GitHub or somewhere else we can use for testing? |
|
I couldnt get the cross origin isolated vite server to run. Would you mind adding it? I added a zip file containing one of the cores i compiled |

This MR adds the support for multi threaded cores.
It does not change the workflow dramatically but a few thing need to be added by the Nostalgist user to make it work.
Multithreaded cores resolve there own files, so two Emscripten hooks need to be used in the launch configs.
Note that this doesnt change the use or possible requirement of resolveCoreWasm and resolveCoreJs in the config.
Other than that the page serving the emulation must be cross origin isolated. This can be done by adding headers to the page like:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp