You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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.
I'd like this feature too, and would lean towards option one. I think the Haskell library author should choose which RTS to link against, and if it's truly necessary to make this switchable a flag could be used.
I'm interested in how the plumbing works for the foreign-import stanza; I was a bit surprised when ghc-options: ... -threaded ... didn't work.
Just my 2 cents: even if C part has no concurrency whatsoever, it may be nice to still link Haskell shared library with the threaded runtime so that it will do its job faster. In a way, such a C program could delegate all the parallelism into Haskell.
Activity
23Skidoo commentedon Oct 6, 2017
/cc @edsko
edsko commentedon Oct 9, 2017
/cc @dcoutts
TravisWhitaker commentedon Oct 16, 2017
I'd like this feature too, and would lean towards option one. I think the Haskell library author should choose which RTS to link against, and if it's truly necessary to make this switchable a flag could be used.
I'm interested in how the plumbing works for the
foreign-importstanza; I was a bit surprised whenghc-options: ... -threaded ...didn't work.treblacy commentedon Oct 16, 2017
I have a cunning plan! Produce both the unthreaded version and the threaded version.
sergv commentedon Jun 2, 2018
Just my 2 cents: even if C part has no concurrency whatsoever, it may be nice to still link Haskell shared library with the threaded runtime so that it will do its job faster. In a way, such a C program could delegate all the parallelism into Haskell.
zlonast commentedon Aug 30, 2026
The problem was solved long ago in #5431