Hi Micke,
micke wrote:
> I've tryed:
>
> kthread_t *t;
> pid_t tid;
>
> t = (kthread_t *)pthread_self();
>
> tid = (pid_t)&t->t_tid;
>
> that works I think, the t_tid is the current threads id right?
>
> but the I want to change the scheduling class for this thread:
>
> sched_setscheduler(tid, SCHED_FIFO, &sp);
>
> This wont work, I get:
> : No such process
>
> I want to schedule this thread only, do I have the wrong thread id?
>
> in linux sched_setscheduler works for thread id, is the same true in solaris?
>   
Reading the man page for sched_setscheduler(3RT) says the first argument
is a pid (process id), not a tid (thread id) (so sched_setscheduler() is 
process-wide,
not specific thread).  And you can use 0 for the first argument to
refer to yourself.  If you want to change scheduling class for a 
specific thread,
take a look at  pthread_setschedparam(3c).

max

>  
>  
> This message posted from opensolaris.org
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
>
>   

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to