Unix Programming - how can I change the priority of thread during Runtime?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2005 > how can I change the priority of thread during Runtime?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author how can I change the priority of thread during Runtime?
Luotao Fu

2005-09-20, 7:49 am

Hi volks,
I'm wondering how I can change the priority of a thread during the
runtime. For example, a thread reduce its priority itself or increase
the priority of another thread while it's running.
pthread_attr_setschedparam() seem to only work outside the thread and
befor the Creation of the thread to me.

For processes I'd use sched_setscheduler() to change their priorities in
Runtime. I read that sched_setscheduler() also works on threads unter
Linux, but it's not posix compliant. The posix compatibility is however
very important for me in this case, thus I suppose that I cannot use
sched_setscheduler().

I'd be very appreciated for any Advices how I could do this with posix
Threads.

Thanx a lot
Cheers
Luotao Fu
Nils O. Selåsdal

2005-09-20, 6:05 pm

Luotao Fu wrote:
> Hi volks,
> I'm wondering how I can change the priority of a thread during the
> runtime. For example, a thread reduce its priority itself or increase
> the priority of another thread while it's running.
> pthread_attr_setschedparam() seem to only work outside the thread and
> befor the Creation of the thread to me.


See pthread_setschedparam

--
Nils O. Selåsdal
www.utelsystems.com
Luotao Fu

2005-09-20, 6:05 pm

Nils O. Selåsdal schrieb:
> Luotao Fu wrote:
>
>
>
> See pthread_setschedparam
>

uups, do should have read the manual with little more attention. :-)
Sorry for the stupid question and Thanx a lot for answering :-).

Cheers
Luotao Fu
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com