Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlatools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlatools
Commits
d1668ba1
Commit
d1668ba1
authored
Mar 24, 2020
by
Markus Alexander Kuppe
Browse files
Options
Downloads
Patches
Plain Diff
All-or-nothing strategy when allocating memory in LiveWorker.
[Refactor][TLC]
parent
db269535
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tlatools/src/tlc2/tool/liveness/LiveWorker.java
+42
-38
42 additions, 38 deletions
tlatools/src/tlc2/tool/liveness/LiveWorker.java
with
42 additions
and
38 deletions
tlatools/src/tlc2/tool/liveness/LiveWorker.java
+
42
−
38
View file @
d1668ba1
...
@@ -202,9 +202,18 @@ public class LiveWorker implements Callable<Boolean> {
...
@@ -202,9 +202,18 @@ public class LiveWorker implements Callable<Boolean> {
final
int
slen
=
this
.
oos
.
getCheckState
().
length
;
final
int
slen
=
this
.
oos
.
getCheckState
().
length
;
final
int
alen
=
this
.
oos
.
getCheckAction
().
length
;
final
int
alen
=
this
.
oos
.
getCheckAction
().
length
;
// Synchronize all LiveWorker instances to consistently read free
// memory. This method is only called during initialization of SCC
// search, thus synchronization should not cause significant thread
// contention. We want a single LW to successfully allocate both
// dfsStack *and* comStack.
final
IntStack
dfsStack
;
final
IntStack
comStack
;
synchronized
(
LiveWorker
.
class
)
{
// Tarjan's stack
// Tarjan's stack
// Append thread id to name for unique disk files during concurrent SCC search
// Append thread id to name for unique disk files during concurrent SCC search
final
IntStack
dfsStack
=
getStack
(
liveCheck
.
getMetaDir
(),
"dfs"
+
this
.
id
);
dfsStack
=
getStack
(
liveCheck
.
getMetaDir
(),
"dfs"
+
this
.
id
);
// comStack is only being added to during the deep first search. It is passed
// comStack is only being added to during the deep first search. It is passed
// to the checkComponent method while in DFS though. Note that the nodes pushed
// to the checkComponent method while in DFS though. Note that the nodes pushed
...
@@ -213,7 +222,8 @@ public class LiveWorker implements Callable<Boolean> {
...
@@ -213,7 +222,8 @@ public class LiveWorker implements Callable<Boolean> {
//
//
// See tlc2.tool.liveness.LiveWorker.DetailedFormatter.toString(MemIntStack)
// See tlc2.tool.liveness.LiveWorker.DetailedFormatter.toString(MemIntStack)
// which is useful during debugging.
// which is useful during debugging.
final
IntStack
comStack
=
getStack
(
liveCheck
.
getMetaDir
(),
"com"
+
this
.
id
);
comStack
=
getStack
(
liveCheck
.
getMetaDir
(),
"com"
+
this
.
id
);
}
// Generate the SCCs and check if they contain a "bad" cycle.
// Generate the SCCs and check if they contain a "bad" cycle.
while
(
nodeQueue
.
size
()
>
0
)
{
while
(
nodeQueue
.
size
()
>
0
)
{
...
@@ -462,11 +472,6 @@ public class LiveWorker implements Callable<Boolean> {
...
@@ -462,11 +472,6 @@ public class LiveWorker implements Callable<Boolean> {
}
}
private
IntStack
getStack
(
final
String
metaDir
,
final
String
name
)
throws
IOException
{
private
IntStack
getStack
(
final
String
metaDir
,
final
String
name
)
throws
IOException
{
// Synchronize all LiveWorker instances to consistently read free
// memory. This method is only called during initialization of SCC
// search, thus synchronization should not cause significant thread
// contention.
synchronized
(
LiveWorker
.
class
)
{
// It is unlikely that the stacks will fit into memory if the
// It is unlikely that the stacks will fit into memory if the
// size of the behavior graph is larger relative to the available
// size of the behavior graph is larger relative to the available
// memory. Also take the total number of simultaneously running
// memory. Also take the total number of simultaneously running
...
@@ -491,7 +496,6 @@ public class LiveWorker implements Callable<Boolean> {
...
@@ -491,7 +496,6 @@ public class LiveWorker implements Callable<Boolean> {
// disk-backed SynchronousDiskIntStack.
// disk-backed SynchronousDiskIntStack.
return
new
MemIntStack
(
metaDir
,
name
);
return
new
MemIntStack
(
metaDir
,
name
);
}
}
}
/**
/**
* For currentPEM, this method checks if the current SCC satisfies its AEs
* For currentPEM, this method checks if the current SCC satisfies its AEs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment