QuTech-Delft / qx-simulator

QX Simulator
Other
16 stars 12 forks source link

"Fix" pthread_setaffinity errors #82

Closed jvanstraten closed 3 years ago

jvanstraten commented 3 years ago

This works around the occasional thread::start() : pthread_setaffinity_np() failed exception that's been plaguing the Quantum Inspire team. The exception most likely occurs because m_cpu is only initialized when set_cpu() is first called and thus might contain garbage for some code paths, or perhaps because set_cpu() is called with garbage. I just tore out the entire processor affinity call; it really shouldn't functionally matter what processor a thread runs on, and in terms of performance I doubt this would actually have helped, considering the state of the codebase.