Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
c82a7515
Commit
c82a7515
authored
6 years ago
by
klijn1
Browse files
Options
Downloads
Patches
Plain Diff
Additional plotting
parent
779def9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/risotto/thread_forwarding_sampler.hpp
+4
-1
4 additions, 1 deletion
example/risotto/thread_forwarding_sampler.hpp
with
4 additions
and
1 deletion
example/risotto/thread_forwarding_sampler.hpp
+
4
−
1
View file @
c82a7515
...
@@ -65,6 +65,7 @@ public:
...
@@ -65,6 +65,7 @@ public:
{
// take the lock
{
// take the lock
std
::
lock_guard
<
std
::
mutex
>
guard
(
mutex_
);
std
::
lock_guard
<
std
::
mutex
>
guard
(
mutex_
);
traces_
.
push_back
({
probe_id
.
gid
,
probe_id
.
index
,
std
::
move
(
trace
)
});
traces_
.
push_back
({
probe_id
.
gid
,
probe_id
.
index
,
std
::
move
(
trace
)
});
}
}
//Tell the other side to wake up outside of the lock
//Tell the other side to wake up outside of the lock
...
@@ -102,6 +103,7 @@ void publisher(
...
@@ -102,6 +103,7 @@ void publisher(
// We now have the mutex
// We now have the mutex
// Copy / swap the mutex guarded variables
// Copy / swap the mutex guarded variables
traces_local
.
clear
();
// assure we are empty
traces_local
.
swap
(
traces
);
traces_local
.
swap
(
traces
);
quit_local
=
quit
;
quit_local
=
quit
;
...
@@ -111,6 +113,7 @@ void publisher(
...
@@ -111,6 +113,7 @@ void publisher(
wake_up
.
notify_one
();
wake_up
.
notify_one
();
// Simple plotting
// Simple plotting
std
::
cout
<<
"We are sending traces: "
<<
traces_local
.
size
()
<<
"
\n
"
;
for
(
auto
&
entry
:
traces_local
)
{
for
(
auto
&
entry
:
traces_local
)
{
auto
gid
=
std
::
get
<
0
>
(
entry
);
auto
gid
=
std
::
get
<
0
>
(
entry
);
auto
lid
=
std
::
get
<
1
>
(
entry
);
auto
lid
=
std
::
get
<
1
>
(
entry
);
...
@@ -130,7 +133,7 @@ void publisher(
...
@@ -130,7 +133,7 @@ void publisher(
multimeter
.
Record
(
datum
);
multimeter
.
Record
(
datum
);
}
}
}
}
traces_local
.
clear
();
relay
.
Send
(
multimeter
.
node
());
relay
.
Send
(
multimeter
.
node
());
multimeter
.
node
().
reset
();
multimeter
.
node
().
reset
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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