Better threading so data will be handled as efficiently as possible
codedwrench opened this issue · 0 comments
3 threads are started, USB, Receive, Send.
-
The USB receive portion will only go as far as identifying the data and the data size, i'd rather have this in the ReceiveThread as well, but that will desync and you will get USB writes when not nessecary (I have no idea if the PSP will handle that gracefully). I will just have to make this as efficient as possible
-
ReceiveThread will handle stitching packets, possibly filtering and further identifying the data, also formatting and sending to XLink.
-
SendThread will handle grabbing data from XLink, filtering it down, splitting it up and formatting it.
-
USB send portion will grab from the buffer SendThread is serving up, the data should be ready to go when USBWrite is called.
Stopping threads isn't covered very deeply in the diagram as it was getting big enough as is, but basically a StopRequest is send to all threads from the main thread, the threads will decide what to with it at the beginning of their cycle