Re: Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-14 Thread Daniel Gorín
On Jul 13, 2009, at 10:53 PM, Marc Weber wrote: Yes, it is a known limitation. It ought to be documented somewhere. There are two problems: 1. GHC is not thread-safe. [...] 2. There is only one RTS linker with a single symbol table. [...] Are there already bug tracker items for these

Re: Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-13 Thread Simon Marlow
On 12/07/2009 16:49, Daniel Gorín wrote: Hi I'm trying to use the GHC API to have several instances of GHC's interpreter loaded simultaneously; each with its own loaded modules, etc. However, this doesn't seem to work well when two instances have loaded modules with the same name. I'm including

Re: Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-13 Thread Marc Weber
Yes, it is a known limitation. It ought to be documented somewhere. There are two problems: 1. GHC is not thread-safe. There are some items of global state (the NameCache and the PackageInterfaceTable) that should be protected. It's not a trivial matter to do this - we had a

Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-12 Thread Daniel Gorín
Hi I'm trying to use the GHC API to have several instances of GHC's interpreter loaded simultaneously; each with its own loaded modules, etc. However, this doesn't seem to work well when two instances have loaded modules with the same name. I'm including the code of a small(ish) example

Re: Using the ghc-api to run more than one instance of ghc simultaneously

2009-07-12 Thread Marc Weber
On Sun, Jul 12, 2009 at 05:49:15PM +0200, Daniel Gorín wrote: Hi I'm trying to use the GHC API to have several instances of GHC's interpreter loaded simultaneously; [snip] Is this possible now? 6-12 month ago it was not possible to run multiple ghc threads within the same instance due to