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

All the runScheduledAction complexity seems to be redundant

Abierto
#425 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
haskell

Línea de trabajo

Comienza comparando los commits referenciados 3855e91 y 876a3dc; después, sigue runScheduledAction y sendOn para entender las garantías de orden alrededor de la MVar. Determina si la complejidad de la programación es redundante y documenta un alcance concreto y comprobable antes de cambiarla.

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

Descripción

network-transport-tcp

From the https://github.com/haskell-distributed/network-transport-tcp/commit/3855e91dcad7381f6626fc47adb8f4c9c60d5279:

Simply doing

thingToSend <- modifyMVar (....)
send thingToSend

is not good enough, because now if we have to threads doing the above the sends
may be done in the wrong order.

Before https://github.com/haskell-distributed/network-transport-tcp/commit/876a3dc94e516c9ec60ea8b0a65ea3f13b8c1f27 it was true. But after sendOn was protected with MVar it seems that it became redundant, because, as @simonmar states in his book:

if a thread T is blocked in takeMVar and there are regular putMVar operations on the same MVar, it is guaranteed that at some point thread T’s takeMVar will return. In GHC, this guarantee is implemented by keeping blocked threads in a FIFO queue attached to the MVar...

In other words, the first thread called sendOn and blocked on MVar will be served first when the MVar will be available (if I understood correctly the book). So it seems that "simply doing" approach mentioned in the beginning will just do. No?

CC @edsko

Lenguaje dominante
Haskell
Estrellas
753
Forks
101
Merge medio
1 d 3 h
PR fusionados (30 d)
4

Preparar el entorno

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 haskell-distributed/distributed-process

Todos los issues de haskell-distributed/distributed-process

Issues similares

Más issues de Haskell

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.