Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jberryman
GHC
Commits
24bbc3e7
Commit
24bbc3e7
authored
Dec 19, 2014
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the linker to run concurrently with the GC
parent
2a103c7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
rts/CheckUnload.c
rts/CheckUnload.c
+2
-2
rts/Linker.c
rts/Linker.c
+13
-0
rts/LinkerInternals.h
rts/LinkerInternals.h
+1
-0
No files found.
rts/CheckUnload.c
View file @
24bbc3e7
...
...
@@ -260,7 +260,7 @@ void checkUnload (StgClosure *static_objects)
if
(
unloaded_objects
==
NULL
)
return
;
ACQUIRE_LOCK
(
&
linker_mutex
);
ACQUIRE_LOCK
(
&
linker_
unloaded_
mutex
);
// Mark every unloadable object as unreferenced initially
for
(
oc
=
unloaded_objects
;
oc
;
oc
=
oc
->
next
)
{
...
...
@@ -320,5 +320,5 @@ void checkUnload (StgClosure *static_objects)
freeHashTable
(
addrs
,
NULL
);
RELEASE_LOCK
(
&
linker_mutex
);
RELEASE_LOCK
(
&
linker_
unloaded_
mutex
);
}
rts/Linker.c
View file @
24bbc3e7
...
...
@@ -156,7 +156,15 @@ ObjectCode *objects = NULL; /* initially empty */
ObjectCode
*
unloaded_objects
=
NULL
;
/* initially empty */
#ifdef THREADED_RTS
/* This protects all the Linker's global state except unloaded_objects */
Mutex
linker_mutex
;
/*
* This protects unloaded_objects. We have a separate mutex for this, because
* the GC needs to access unloaded_objects in checkUnload, while the linker only
* needs to access unloaded_objects in unloadObj(), so this allows most linker
* operations proceed concurrently with the GC.
*/
Mutex
linker_unloaded_mutex
;
#endif
/* Type of the initializer */
...
...
@@ -1648,6 +1656,7 @@ initLinker_ (int retain_cafs)
#if defined(THREADED_RTS)
initMutex
(
&
linker_mutex
);
initMutex
(
&
linker_unloaded_mutex
);
#if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO)
initMutex
(
&
dl_mutex
);
#endif
...
...
@@ -3235,9 +3244,13 @@ static HsInt unloadObj_ (pathchar *path, rtsBool just_purge)
}
else
{
prev
->
next
=
oc
->
next
;
}
ACQUIRE_LOCK
(
&
linker_unloaded_mutex
);
oc
->
next
=
unloaded_objects
;
unloaded_objects
=
oc
;
oc
->
status
=
OBJECT_UNLOADED
;
RELEASE_LOCK
(
&
linker_unloaded_mutex
);
// We do not own oc any more; it can be released at any time by
// the GC in checkUnload().
}
else
{
prev
=
oc
;
}
...
...
rts/LinkerInternals.h
View file @
24bbc3e7
...
...
@@ -146,6 +146,7 @@ extern ObjectCode *unloaded_objects;
#ifdef THREADED_RTS
extern
Mutex
linker_mutex
;
extern
Mutex
linker_unloaded_mutex
;
#endif
void
exitLinker
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment