| View previous topic :: View next topic |
| Author |
Message |
jockyw2001
Joined: 29 Sep 2005 Posts: 339
|
Posted: Tue Jun 13, 2006 1:11 am Post subject: sceKernelCreateThread: optimal priority values |
|
|
| How can I determine the optimal priority value for a thread created with sceKernelCreateThread? For example in my app I have a network thread with priority 0x18, a decode thread with 0x16 and a video thread with 0x16. I noticed that the performance of my app can change rather dramatically if I tweak the priority values. So far it has been trial and error, I'm looking for a systematic approach. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Jun 13, 2006 4:20 am Post subject: |
|
|
Alas I do not think there is really much of a systematic approach you can take to thread priorities, it really depends on the types of work each thread is performing and how resistent they would be to interruptions. It also will depend how they interact with each other.
Based on your example I would probably say that the decode thread is probably doing the most work therefore it probably should have a lower thread priority (i.e. a higher number) than the other two as they are likely to be relatively short lived and reactive. In general I would say anything which tends to go into a wait state often (e.g. IO bound stuff such as a network thread or something limited by the blank interval such as a video thread) would need to be higher priority to ensure that they can react as quickly as possible to the event to prevent stalling the decode too much and go back as quickly as possible to the wait state.
Of course I dont know the exact work your code is doing, so it is hard to say for certain, it probably really is a case of suck it and see. I'll try to remember to add a function to tweak the thread priority from the psplink shell so you can test what works best at runtime :) |
|
| Back to top |
|
 |
jockyw2001
Joined: 29 Sep 2005 Posts: 339
|
Posted: Tue Jun 13, 2006 4:33 am Post subject: |
|
|
| TyRaNiD wrote: | | I'll try to remember to add a function to tweak the thread priority from the psplink shell so you can test what works best at runtime :) |
That would be wonderful. Psplink is already a HUGE timesaver and it's getting better all the time. Thank you very much. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Jun 13, 2006 5:41 am Post subject: |
|
|
| Committed fyi. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue Jun 13, 2006 10:43 am Post subject: |
|
|
o0oo very delicious commit :)
also note i find that you should never
go below 0x11 for priority as your update
thread should be at that level so no 0x01-0x11
should be touched _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
jonny
Joined: 22 Sep 2005 Posts: 351
|
Posted: Tue Jun 13, 2006 6:06 pm Post subject: |
|
|
@dot_blank:
really interesting infos! (i guess there are some system threads that need to have more priority)
in pmpmod actually i have 3 threads with pri < 0x11 (4 if i count the implicit async-reading thread)
this can explain some rare problems i have while testing (i'm going to check) |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Fri Dec 28, 2007 1:13 am Post subject: |
|
|
[QUOTE=Tyranid] I'll try to remember to add a function to tweak the thread priority from the psplink shell so you can test what works best at runtime :) [/QUOTE]
Which function is it? _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
|