libTAS icon indicating copy to clipboard operation
libTAS copied to clipboard

get_nprocs and get_nprocs_conf should be overriden

Open CasualPokePlayer opened this issue 1 year ago • 1 comments

These functions are used for determining the amount of CPU cores available (used by sysconf's _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN, along with std::thread::hardware_concurrency internally, probably other places too). Currently libTAS does not override these and so the host CPU core count is exposed. It might be better here to override them to always return 1 (or an adjustable value so some games don't maybe softlock?), to maybe have games limit their thread count to 1.

CasualPokePlayer avatar Dec 28 '22 10:12 CasualPokePlayer

It is a good idea, and I tried that. One issue is that you want as many threads as possible for OpenGL software rendering. Also, it did not fix any of Unity sync issues because it does not always rely on that value, and can spawn many threads. So I'm unsure it is very useful.

clementgallet avatar Jan 17 '24 22:01 clementgallet