Skip to content

foreign-library: Which RTS to link against? #4815

@treblacy

Description

@treblacy

Thank you for the foreign-library addition, it is pretty sweet, it makes my life easier as the author of Calling Haskell Shared Libraries from C (Linux) 😆

Currently it links against the unthreaded GHC RTS. So there is potential that one day someone has a multi-threaded C program that uses a Haskell library built this way, calls Haskell functions from multiple threads concurrently, and there will be a problem. (The unthreaded RTS detects reentrancy and simply aborts the whole program with a "schedule: re-entered unsafely" message.)

I am not sure what I request instead:

  1. Add moar settings so a dev of a foreign-library can choose. But I'm not sure who is in the best position to choose, the Haskell foreign-library dev or the C program dev.

  2. Link against the threaded RTS across the board. But I'm not sure this harms no one; I don't even know the statistics of how many people have to avoid the threaded RTS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions