[Haskell-cafe] Top Level <-
ganesh at earth.li
Mon Sep 1 01:33:25 EDT 2008
On Sun, 31 Aug 2008, Brandon S. Allbery KF8NH wrote:
> On 2008 Aug 31, at 13:20, Ganesh Sittampalam wrote:
>> I'm afraid I don't see how this generalises to sharing something across an
>> entire process where the things that want to do the sharing are not in or
>> controlled by the same shared library. In particular the filehandle
>> structures required for buffered I/O need to be common to every single
>> piece of code in the process that might want to use them, no matter what
>> language or language implementation that code uses.
> For that you probably want to look at how ld.so.1 and libc interact to
> share the malloc pool and the stdin/stdout/stderr, among others.
If buffered IO is handled by libc rather than by specific language
runtimes, then the same mechanism of using global variables inside libc
would work fine; but this technique doesn't extend to providing
process-scope shared state for library code that might be loaded multiple
times with no knowledge of the other instances.
More information about the Haskell-Cafe