Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Synchronisation of `wait()` and `kill()`

Abierto
#792 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp

Línea de trabajo

The issue names no files, tests or entry points, so first find where the worker threads call kill() and where the OS handler calls wait(). The open question is the synchronization design: the issue asks that the two never run at the same time for the same process identifier, and that a worker which loses the race backs out. Done means the design is agreed, the race is covered by a test, and a worker that loses the race leaves no stray kill().

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
What

My understanding of POSIX is as follows:

When a process has terminated, it stays in the kernel's table as a zombie process until the parent has read its exit status using wait(). As soon as wait() returns, the kernel is free to delete the process and reuse its identifier.

Therefore, if we attempt to call kill() after wait(), there is a chance that we kill some completely unrelated process.

Although process identifiers are usually sequential, making this very unlikely, there is nothing which says they must be allocated that way. And even if they are, the point where the number wraps around can be arbitrarily low.

Acceptance Criteria (DoD)
  • Use of invalid process identifiers is prevented
How

If my understanding is correct, then we must guarantee that these do not happen simultanously:

  • Worker threads calling kill()
  • The OS handler calling wait()

If kill() goes first, it will find the zombie process and return ESRCH. We already handle this case properly.

If wait() goes first, and a worker thread is waiting to kill() the same identifier, the worker thread must back out without doing anything.

Lenguaje dominante
C++
Estrellas
6
Forks
35
Merge medio
2 d 5 h
PR fusionados (30 d)
101

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-score/lifecycle

Todos los issues de eclipse-score/lifecycle

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.