Here is a counter question to get you on the right path: How have you implemented interrupts? 

Thread emulation depends a little bit on the kind of emulation that you are aiming for: Are you writing a HLE or a cycle-accurate emulator? Full and correct CPU emulation should give you the threading for free once you run the PS2 Kernel in your emulator (which would be naughty). On the other hand, the typical HLE approach would be to implement as much on the platform that the emulator runs on so in this case you probably would want to write the thread scheduler on your own. 


On May 20, 2008, at 6:43 AM, Sebastian Lucas wrote:

Thanks to all guys!
I think then maybe mixing the things together and by doing some hacks I would let it work.

I've written some demos with my ps2 (using the ps2link) using threads but it's different when you really want to write an emulator... remember that this is just to boost my knowledge.

I'd really appreciated the replies =)