This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Emulator
#30
(11-13-2012, 03:07 PM)Runo Wrote: But then you're saying someone with the right skills could multithread a single chip emulation without losing performance over cores? Cause I never heard of someone that did this (A dev from Dolphin emulator team tried a while back, he wanted to write a multithreaded JIT that split the emulated CPU thread into two logical threads, but he gave up, and he told us over the IRC channel he wasn't gaining much speed even if it was using all of his CPU cores, because of the need for tight thread syncing)

The emulated CPU is single cored, so it works in serialized manner. Even if you parallelize the emulation one thread will need to wait for the other, I don't see how that could be optimized.
I'm planning to add real multi-threading for the PSP threads in Jpcsp. Jpcsp is already using multiple cores for the emulation of the PSP hardware, but the PSP threads are currently always running one at a time (like on a real PSP). Most of the applications coded for the PSP do however already use thread synchronization (Mutex/Sema/EventFlag/...) internally. But they were never tested on a real hardware multi-threading, as the PSP has a single MIPS CPU Wink. This feature would be available as an option, for PSP applications programmed in a thread-safe way Smile.
The most difficult part for this approach will be to make the Jpcsp HLE calls thread-safe (or they could be sequentialized automatically). The implementation of sceKernelCpuSuspendIntr/sceKernelCpuResumeIntr which are often used by PSP applications to protect a critical section is also a challenge. On a PSP, these 2 calls are lightweight and do not involve much overhead. On a truly multi-threaded system, they would imply to stop all the other running threads, which is not obvious without adding too much overhead.

The point is, when going beyond the capabilities of the emulated system, a solution doesn't have to be 100% perfect. It can be offered as an option or can work only under some conditions.
Reply


Messages In This Thread
Emulator - by carroacelera - 11-06-2012, 11:13 PM
RE: Emulator - by Zekro - 11-07-2012, 02:00 PM
RE: Emulator - by Runo - 11-11-2012, 04:34 PM
RE: Emulator - by montcer9012 - 11-11-2012, 05:01 PM
RE: Emulator - by Runo - 11-11-2012, 05:59 PM
RE: Emulator - by montcer9012 - 11-11-2012, 06:46 PM
RE: Emulator - by montcer9012 - 11-07-2012, 04:17 PM
RE: Emulator - by carroacelera - 11-07-2012, 04:33 PM
RE: Emulator - by montcer9012 - 11-07-2012, 04:39 PM
RE: Emulator - by carroacelera - 11-07-2012, 04:42 PM
RE: Emulator - by hlide - 11-12-2012, 11:36 PM
RE: Emulator - by montcer9012 - 11-13-2012, 01:40 AM
RE: Emulator - by Zekro - 11-07-2012, 04:43 PM
RE: Emulator - by montcer9012 - 11-07-2012, 04:44 PM
RE: Emulator - by carroacelera - 11-07-2012, 04:49 PM
RE: Emulator - by Zekro - 11-07-2012, 04:55 PM
RE: Emulator - by carroacelera - 11-07-2012, 05:01 PM
RE: Emulator - by Zekro - 11-07-2012, 05:27 PM
RE: Emulator - by carroacelera - 11-07-2012, 05:29 PM
RE: Emulator - by montcer9012 - 11-07-2012, 05:41 PM
RE: Emulator - by Zekro - 11-07-2012, 05:43 PM
RE: Emulator - by Zekro - 11-11-2012, 05:11 PM
RE: Emulator - by Zekro - 11-11-2012, 06:22 PM
RE: Emulator - by Runo - 11-12-2012, 04:29 AM
RE: Emulator - by Runo - 11-13-2012, 12:45 AM
RE: Emulator - by hlide - 11-13-2012, 01:45 AM
RE: Emulator - by Runo - 11-13-2012, 10:29 AM
RE: Emulator - by hlide - 11-13-2012, 02:02 PM
RE: Emulator - by Runo - 11-13-2012, 03:07 PM
RE: Emulator - by gid15 - 11-13-2012, 05:17 PM
RE: Emulator - by hlide - 11-13-2012, 09:41 PM
RE: Emulator - by Runo - 11-13-2012, 11:49 PM
RE: Emulator - by Gundark - 11-22-2012, 04:38 PM
RE: Emulator - by Zekro - 11-22-2012, 04:40 PM
RE: Emulator - by Gundark - 11-22-2012, 07:36 PM
RE: Emulator - by Zekro - 11-22-2012, 07:52 PM
RE: Emulator - by Gundark - 11-22-2012, 09:57 PM
RE: Emulator - by Runo - 11-23-2012, 03:52 AM
RE: Emulator - by Gundark - 11-23-2012, 06:18 AM
RE: Emulator - by shin x - 11-23-2012, 09:23 AM
RE: Emulator - by montcer9012 - 11-24-2012, 02:11 AM
RE: Emulator - by Gundark - 11-24-2012, 06:54 AM
RE: Emulator - by shin x - 11-24-2012, 05:05 PM
RE: Emulator - by BlackDaemon - 11-24-2012, 07:57 PM
RE: Emulator - by shin x - 11-24-2012, 08:59 PM
RE: Emulator - by Zekro - 11-24-2012, 09:05 PM
RE: Emulator - by shin x - 11-24-2012, 09:55 PM
RE: Emulator - by montcer9012 - 11-24-2012, 09:27 PM
RE: Emulator - by Runo - 11-25-2012, 12:12 PM
RE: Emulator - by montcer9012 - 11-25-2012, 07:55 PM
RE: Emulator - by hlide - 11-26-2012, 04:26 PM
RE: Emulator - by Gundark - 11-26-2012, 09:53 PM
RE: Emulator - by montcer9012 - 11-26-2012, 09:56 PM
RE: Emulator - by BlackDaemon - 11-25-2012, 12:55 PM
RE: Emulator - by Zekro - 11-25-2012, 01:15 PM
RE: Emulator - by shin x - 11-25-2012, 03:44 PM
RE: Emulator - by Zekro - 11-25-2012, 03:53 PM
RE: Emulator - by shin x - 11-25-2012, 04:30 PM
RE: Emulator - by Zekro - 11-25-2012, 04:39 PM
RE: Emulator - by shin x - 11-25-2012, 04:47 PM
RE: Emulator - by Gundark - 11-25-2012, 05:41 PM
RE: Emulator - by Zekro - 11-25-2012, 05:49 PM
RE: Emulator - by BlackDaemon - 11-25-2012, 05:50 PM
RE: Emulator - by Gundark - 11-25-2012, 06:25 PM
RE: Emulator - by shin x - 11-26-2012, 12:53 PM
RE: Emulator - by Zekro - 11-25-2012, 06:31 PM
RE: Emulator - by shin x - 11-26-2012, 07:08 PM
RE: Emulator - by hlide - 11-27-2012, 02:32 AM
RE: Emulator - by shin x - 11-27-2012, 03:31 PM
RE: Emulator - by Runo - 11-27-2012, 11:02 PM
RE: Emulator - by shin x - 11-28-2012, 12:58 PM
RE: Emulator - by Gundark - 11-29-2012, 01:03 AM
RE: Emulator - by Runo - 11-29-2012, 10:31 AM
RE: Emulator - by hlide - 11-29-2012, 09:32 PM
RE: Emulator - by shin x - 11-29-2012, 01:08 PM
RE: Emulator - by Gundark - 11-29-2012, 01:49 PM
RE: Emulator - by Ekaseo - 11-29-2012, 10:02 PM
RE: Emulator - by Runo - 11-30-2012, 12:12 AM
RE: Emulator - by Zekro - 11-30-2012, 10:52 AM
RE: Emulator - by Gundark - 12-01-2012, 07:18 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)