forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EE/IOP priority

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Sat Jun 11, 2005 8:01 pm    Post subject: EE/IOP priority Reply with quote

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)
Back to top
View user's profile Send private message
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Sun Jun 12, 2005 12:37 am    Post subject: Reply with quote

I added select to my code before each call to send and recv, but it seems the EE is still hogging. Any ideas how to make it yield? The loop is running in the main thread, I'm a bit new to all this to know if this is right or not...
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Jun 12, 2005 12:44 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Sun Jun 12, 2005 3:54 am    Post subject: Reply with quote

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)
Back to top
View user's profile Send private message
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Sun Jun 12, 2005 4:12 am    Post subject: Reply with quote

Another curiosity is that the printf side effect only works when there is a send and a recv in the loop.

If I remove the recv so the PS2 is only sending, the speed is slow. If I remove the printf and the PS2 sends and recvs, the speed is again slow :)
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Jun 17, 2005 8:10 am    Post subject: Reply with quote

You might consider posting the code. It's probably something really simple that you're too close to see. You're reading what you MEANT to write instead of what you actually wrote. :D
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group