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 

thread problems

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



Joined: 01 Dec 2005
Posts: 2

PostPosted: Fri Dec 02, 2005 2:38 am    Post subject: thread problems Reply with quote

Hi,

I have several worker threads that are rotated by a scheduler thread whenever it is woken up by an alarm interrupt;
One that checks for gamepad input and updates the UI and another that decodes and streams an mp3.

The problem is when the UI thread makes a call to SifCallRpc it some times happens that it doesn't lose control and the mp3 thread starves. I think the alarm callback is not getting executed but I am not sure what's going on..

here is the code if anyone wants to take a look
http://ntba2.de/junk/scheduler.c
http://ntba2.de/junk/scheduler.h


ntba2
Back to top
View user's profile Send private message Visit poster's website
EEUG



Joined: 13 May 2005
Posts: 136
Location: The Netherlands

PostPosted: Sat Dec 03, 2005 6:44 pm    Post subject: Reply with quote

...I would try to alter "void Scheduler_Run( void )" function this way:

alarmID = SetAlarm( SCHEDULER_TIME_SLICE, Scheduler_Alarm, 0 );

while(1){
SleepTread ();
RotateThreadReadyQueue( SCHEDULER_PRIO_THREAD );
}

and 'Scheduler_Alarm' like this:

void Scheduler_Alarm( s32 id, u16 time, void *arg ) {
iWakeupThread ( Scheduler_RunThreadID );
}

...or even better to get rid of 'Scheduler_Run' function, and use only alarm handler to rotate therad queue. I'm not sure if it will work, it's just a suggestion :)
Best regards
Eugene
Back to top
View user's profile Send private message
ntba2



Joined: 01 Dec 2005
Posts: 2

PostPosted: Mon Dec 05, 2005 9:01 am    Post subject: Reply with quote

Hi EEUG,

thanks I'll give that a try and see if it makes any difference
Back to top
View user's profile Send private message Visit poster's website
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