PCSX2 Documentation/Threading Advanced: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{DocTabs|Section=2}}
''Threading In-Depth''
''Threading In-Depth''


Line 19: Line 18:


A proxy queue thread works as a safety valve because the task it performs is simple enough that we can guarantee it will not deadlock (or at least, if a deadlock does occur its because of some fairly critical system failure). It only locks shared resources -- a message queue list -- for extremely short periods of time, and only to add and remove messages. When the proxy thread forwards messages to the virtual machine, the two threads share a common resource (the virtual machine's message queue); which means that if the VM thread is deadlocked, the proxy thread may deadlock as well. But the proxy thread's own message queue, which it shares with the Main/UI thread, will be unlocked. Thusly, the Main thread does not risk deadlock.
A proxy queue thread works as a safety valve because the task it performs is simple enough that we can guarantee it will not deadlock (or at least, if a deadlock does occur its because of some fairly critical system failure). It only locks shared resources -- a message queue list -- for extremely short periods of time, and only to add and remove messages. When the proxy thread forwards messages to the virtual machine, the two threads share a common resource (the virtual machine's message queue); which means that if the VM thread is deadlocked, the proxy thread may deadlock as well. But the proxy thread's own message queue, which it shares with the Main/UI thread, will be unlocked. Thusly, the Main thread does not risk deadlock.


{{PCSX2 Main Documentation Navbox}}
{{PCSX2 Main Documentation Navbox}}
ninja
782

edits