Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

All the runScheduledAction complexity seems to be redundant

Aperta
#425 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
haskell

Direzione di ricerca

Inizia confrontando i commit referenziati 3855e91 e 876a3dc, quindi segui runScheduledAction e sendOn per comprendere le garanzie sull’ordine relative a MVar. Determina se la complessità della schedulazione è ridondante e documenta un ambito concreto e verificabile prima di modificarla.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Haskell
Stelle
753
Fork
101
Merge medio
1g 3h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di haskell-distributed/distributed-process

Tutte le issue di haskell-distributed/distributed-process

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.