

One thing we know is that for a component to even be worth-while to thread, it needs to have relatively low interaction with other components (which will limit the amount of syncing needed with other components and therefore increase the thread throughput), and it also needs to be a component that is used frequently and is computationally expensive to emulate (or else there’s no point in threading it).

So now you may be wondering, “If threading has all those problems how can you get a speedup?” Well we had to be smart about it, and figure out a way to make threading work based on the properties of the hardware. As an example, both Jake Stine (Air) and I have in the past experimented with naively threading VU1, and in addition to getting unstable graphics and crashes, our attempts also ran slower. The other problem is that just running a component on a thread is actually going to be a slow-down unless the thread is doing a lot of work without having to sync with other components. One problem is that threading the components (say GIF and VU1) at the same time, will lead to very bad syncing errors if the GIF and VU1 need to communicate with each other (and they do). If you try to naively thread the components in the above model, you’ll have 2 huge problems which may not be apparent to non-emu coders. If you want to be safe and accurate at a hardware emulation level, you generally take the approach of running the core CPU of the system (the EE-core in ps2’s case), and then based off the cycles you ran the CPU for, you time the execution of all the other processing units in the system (DMAC (GIF, VIF, SIF, …), VU0/VU1, IPU, IOP, etc…). The key reason is that emulation in general does not lend itself well to threading components.
#Pcsx2 thread creation failure code
In reality, there are plenty of reasons why it’s taken so long for us to code something like MTVU. Some users would go as far as to flame us pcsx2 coders saying we didn’t have the skills to do it or would say some other nonsense. Getting pcsx2 to use more cores is something many people have asked for, and they wondered why we weren’t doing it. Well if you've kept up with pcsx2's SVN, you'll notice we recently added a MTVU (Multi-Threaded microVU1) option, which runs VU1 on its own thread. Originally written by cottonvibes What can and can't be multithreaded
