Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

418
Vistas
pthread_create() : What is default priority and shceduling policy

The HP man page (link) says

"By default, the new thread's scheduling policy and priority are inherited from the creating thread---that is, by default, the pthread_create(3) routine ignores the scheduling policy and priority set in the specified thread attributes object. Thus, to create a thread that is subject to the scheduling policy and priority set in the specified thread attributes object, before calling pthread_create(3) your program must use the pthread_attr_setinheritsched(3) routine to set the inherit thread
attributes object's scheduling attribute to PTHREAD_EXPLICIT_SCHED."

Is this hold true for Linux posix thread (NPTL pthread) ?

If not, what are the factors affecting priority and scheduling policy of a thread created using pthread_create() ?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

From here:

The following values may be specified in inheritsched:

PTHREAD_INHERIT_SCHED Threads that are created using attr inherit scheduling attributes from the creating thread; the scheduling attributes in attr are ignored.

PTHREAD_EXPLICIT_SCHED Threads that are created using attr take their scheduling attributes from the values specified by the attributes object.

The default setting of the inherit scheduler attribute in a newly initialized thread attributes object is PTHREAD_INHERIT_SCHED.

So, seems to be the same behavior as the one described in the question.

I would actually have thought that such a default value could be defined by the standard (without having that much experience with that though, I'll admit), but looking at the last line of the Thread Scheduling Attributes section:

(...) The default values of other scheduling attributes are implementation-defined.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda