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

298
Vistas
Are the C functions recvfrom and sendto mutually exclusive?

I have one thread calling recvfrom with a timeout of 100 ms in a loop. Another thread calls sendto periodically.

Does the sendto function wait until the recvfrom is released by the timeout (or a successful read) or does it send the data during that period of time.

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

0

Are the C functions recvfrom and sendto mutually exclusive?

No. They can both be executed by different threads at the same time.

sendto() doesn't wait for recvfrom() to read the data. It would place the data into the socket's buffer and return. Multiple sendto() may block for the previous sendto() to complete. If any error occurred (buffer full, message too big etc) while sending then you can check inspect errno to check the cause of failure. Basically, you don't need to do any synchronization between sendto() and recvfrom() calls from the two threads; they are atomic operations.

over 4 years ago · Santiago Trujillo Denunciar

0

No, it does not wait, (at least, it does not wait any longer than necessary to gain thread-safe access to the comms stack).

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