Skip to content

Deadlocks In ParAff / Kills #4

@eric-corumdigital

Description

@eric-corumdigital

There are several cases where deadlocks will occur if a Queue is used in any Fiber which is killed (ParAff is a common scenario).

read ∷ ∀ a. Queue a → Aff a
read (Queue q) = do
  readEnd ← AVar.take q.readEnd
  // Kill here leaves readEnd empty
  QItem a newRead ← AVar.read readEnd
  AVar.put newRead q.readEnd
  pure a

Invincibility is not a solution because that will lead to external deadlock problems. I have been long down this road with Aff, and even patched the library to fix a critical temporal issue that will also be at play here. When I am able to share the fix I will.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions