Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda