I've written a simple program (launched using ps2client and ps2link) that opens a socket and sends data to my laptop using ps2ip(s) over ethernet (yes, I've already been warned about the possibility of bugs in ps2ip :)
It is a simple send/recv loop, but takes about 40 seconds to transfer 300K of data. If I add 'printf(".")' into the loop, the same transfer takes about 1 second!...
The helpful guys on IRC pointed out that this could be because the EE is hogging the bus and not allowing the IOP to do its job. How do I yield within the loop to give the IOP a chance?... I tried "SleepThread" in the loop, but the transfer still took around 40 seconds.
Could the problem be that I am using blocking IO? (I'm not using select yet)
EE/IOP priority
I don't see how the EE could starve network comms, which are IOP-specific. Especially since the EE kernel is cooperative, so if your main thread is active then no other threads should take over unless they have a lower priority.
I would guess it's some interference from ps2link on the IOP side. That seems even more likely since you said printf() sped it up, and printf() goes through ps2link.
I would guess it's some interference from ps2link on the IOP side. That seems even more likely since you said printf() sped it up, and printf() goes through ps2link.
Cheers for the info. I did try the same loop in an IRX too, and got the same slow results (I tried this yesterday before I discovered the printf side effect) so that seems to make sense.
I've been having a nosey through the ps2link source, but I'm not clued up enough yet to work out where the problem is (if indeed it is in there)
I've been having a nosey through the ps2link source, but I'm not clued up enough yet to work out where the problem is (if indeed it is in there)