Opened 8 years ago

Last modified 21 months ago

#3372 new feature request

Allow for multiple linker instances

Reported by: jcpetruzza Owned by:
Priority: low Milestone:
Component: Runtime System (Linker) Version:
Keywords: Cc: howard_b_golden@…, ezyang@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: #3658 Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Right now there is only one RTS linker with a single symbol table.This means, for example, that one cannot have multiple instances of the GHC interpreter in the same process running simultaneously.

Attachments (1)

Main.hs (2.4 KB) - added by jcpetruzza 8 years ago.
Example that fails due to this limitation

Download all attachments as: .zip

Change History (18)

Changed 8 years ago by jcpetruzza

Attachment: Main.hs added

Example that fails due to this limitation

comment:1 Changed 8 years ago by igloo

difficulty: Unknown
Milestone: 6.14.1

comment:2 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:3 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:4 Changed 6 years ago by hgolden

Cc: howard_b_golden@… added
Type of failure: None/Unknown

I looked at the attachment. Is it a significant problem to use separate processes when two interpreters are needed? Could you give a use case for this feature that shows its usefulness? Thanks.

comment:5 in reply to:  4 Changed 6 years ago by jcpetruzza

Replying to hgolden:

[...] Could you give a use case for this feature that shows its usefulness? Thanks.

You may want to use ghc in interactive mode to implement some sort of evaluator as part of a Haskell IDE (e.g., like this). You will then want to have one evaluator per opened project and each evaluator naturally corresponds to a ghc session. One can implement this with multiple processes but in an arguably less convenient way.

comment:6 Changed 6 years ago by simonmar

This is indeed a significant ugliness. I think fixing it would be fairly mechanical, just package up the linker's state as an object that gets passed in to every call, and then in GHC the PersistentLinkerState becomes the holder for the RTS linker state and is carried around in the HscEnv rather than being a global variable.

comment:7 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:8 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: normallow

comment:9 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:10 Changed 5 years ago by igloo

Blocked By: 3658 added

comment:11 Changed 5 years ago by ezyang

Cc: ezyang@… added

comment:12 Changed 3 years ago by thomie

Corresponding wiki page: MultipleLinkerInstances

comment:13 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:14 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:15 Changed 2 years ago by ezyang

Component: CompilerRuntime System (Linker)

comment:16 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:17 Changed 21 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.