[MPlayer-dev-eng] [PATCH] -priority support on OS/2

KO Myung-Hun komh at chollian.net
Sun Mar 23 12:48:05 CET 2008


Hi/2.

Dave Yeo wrote:
> On 03/22/08 04:03 am, KO Myung-Hun wrote:
>   
>> Hi/2.
>>
>> This patch implement '-priority' option on OS/2.
>>     
> [...]
>   
>> +} priority_presets_defs[] = {
>> +  { "realtime", MAKESHORT(0, PRTYC_TIMECRITICAL)},
>> +  { "high", MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)},
>> +  { "abovenormal", MAKESHORT(15, PRTYC_REGULAR)},
>> +  { "normal", MAKESHORT(0, PRTYC_REGULAR)},
>> +  { "belownormal", MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)},
>> +  { "idle", MAKESHORT(0, PRTYC_IDLETIME)},
>> +  { NULL, MAKESHORT(0, PRTYC_REGULAR)} /* default */
>> +};
>>     
>
> I wonder if perhaps "high" should be foreground server, eg perhaps 4,15?
> And "abovenormal" 31, PRTC_REGULAR? This would leave only normal and
> abovenormal subject to dynamic priority boosts and smoother operations
> if someone chooses high. 

I want to implement '-priority' as analogous to Win32 as possible. So I 
checked Odin32 and Open32. Open32 define 'realtime', 'high', 'normal', 
'idle' only. They are mapped to ( timecritical, 0 ), ( regular, 0 ), ( 
regular, 0 ), and ( idletime, 0 ), respectively.
Odin32 map thread priority only not priority class. timecritical, 
highest, abovenormal, normal, belownormal, lowest and idle to ( 
timecritical,0 ), ( regular, max ), ( regular, 15 ), ( regular, 0 ), ( 
regular, -15 ), ( regular, min ) and ( idletime, 0 ), respectively.

So by synthesizing these, I concluded to my patch. But in case of 
belownormal, unlike documentation, negative delta is ignored on OS/2. So 
I lower the class of 'belownormal' from regular to idletime, and set its 
delta to max.

And I think, foreground server should be used for daemon. In addition, 
we can achieve smooth operation by adjusting delta as well as class.

> At that I'd consider MPlayer important enough
> that perhaps normal in this context should have some priority boost so
> even "normal" being a bit high, eg 2,15 and "belownormal" being actual
> normal, 2,0.
>   

If you want a bit high priority, just use a bit high priority option 
without treating MPlayer as the special one.

> It is hard to imagine wanting to run it at 1,31 as any other process
> running at normal would preempt it though for a large mencoder job it
> may make sense.
>
>   

As I said above, just use 'normal' priority for that, or the more proper 
one. It's just up to user.

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 1.1.8
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1 GHz with 512 MB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr





More information about the MPlayer-dev-eng mailing list