Home > other >  Linux ubuntu a super user thread priority is how to improve?
Linux ubuntu a super user thread priority is how to improve?

Time:11-06

Through setting the priority of this code can only be used to super jurisdictions, the super authority there will create a thread failure, remove the priority setting of super authority used to cause a decline in the efficiency of reading and writing the DMA timeout, under the guidance of the great god, thank you
Pthread_attr_t attr;
Struct sched_param param.
CTX - & gt; Int_call_back=fun_int;
If (pthread_attr_init (& amp; Attr)!=0)
Return INT_THREAD_ATTR_SET_FAILED;
Param. Sched_priority=sched_get_priority_max (SCHED_RR);
Pthread_attr_setschedpolicy (& amp; Attr, SCHED_RR);
Pthread_attr_setschedparam (& amp; Attr, & amp; Param);
Pthread_attr_setinheritsched (& amp; Attr, PTHREAD_EXPLICIT_SCHED);
CTX - & gt; Int_arg=in_arg;
If (pthread_create (& amp; CTX - & gt; Int_tid, & amp; Attr, __int_thread, dev)!=0)

CodePudding user response:

Mandatory set priority number, give it a try
  • Related