Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
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
cpp-libs
Actor Framework
Commits
8f7812e6
Commit
8f7812e6
authored
Feb 20, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid putting two stream stages to the same worker
parent
c42dcaf0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
10 deletions
+15
-10
libcaf_core/caf/policy/work_sharing.hpp
libcaf_core/caf/policy/work_sharing.hpp
+1
-1
libcaf_core/caf/policy/work_stealing.hpp
libcaf_core/caf/policy/work_stealing.hpp
+4
-1
libcaf_core/caf/scheduler/abstract_coordinator.hpp
libcaf_core/caf/scheduler/abstract_coordinator.hpp
+2
-2
libcaf_core/caf/scheduler/coordinator.hpp
libcaf_core/caf/scheduler/coordinator.hpp
+2
-2
libcaf_core/caf/scheduler/test_coordinator.hpp
libcaf_core/caf/scheduler/test_coordinator.hpp
+1
-1
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+4
-2
libcaf_core/src/test_coordinator.cpp
libcaf_core/src/test_coordinator.cpp
+1
-1
No files found.
libcaf_core/caf/policy/work_sharing.hpp
View file @
8f7812e6
...
@@ -64,7 +64,7 @@ public:
...
@@ -64,7 +64,7 @@ public:
}
}
template
<
class
Coordinator
>
template
<
class
Coordinator
>
void
central_enqueue
(
Coordinator
*
self
,
resumable
*
job
)
{
void
central_enqueue
(
Coordinator
*
self
,
resumable
*
job
,
execution_unit
*
)
{
enqueue
(
self
,
job
);
enqueue
(
self
,
job
);
}
}
...
...
libcaf_core/caf/policy/work_stealing.hpp
View file @
8f7812e6
...
@@ -102,8 +102,11 @@ public:
...
@@ -102,8 +102,11 @@ public:
}
}
template
<
class
Coordinator
>
template
<
class
Coordinator
>
void
central_enqueue
(
Coordinator
*
self
,
resumable
*
job
)
{
void
central_enqueue
(
Coordinator
*
self
,
resumable
*
job
,
execution_unit
*
avoid
)
{
auto
w
=
self
->
worker_by_id
(
d
(
self
).
next_worker
++
%
self
->
num_workers
());
auto
w
=
self
->
worker_by_id
(
d
(
self
).
next_worker
++
%
self
->
num_workers
());
while
(
w
==
avoid
)
w
=
self
->
worker_by_id
(
d
(
self
).
next_worker
++
%
self
->
num_workers
());
w
->
external_enqueue
(
job
);
w
->
external_enqueue
(
job
);
}
}
...
...
libcaf_core/caf/scheduler/abstract_coordinator.hpp
View file @
8f7812e6
...
@@ -58,8 +58,8 @@ public:
...
@@ -58,8 +58,8 @@ public:
return
utility_actors_
.
size
();
return
utility_actors_
.
size
();
}
}
/// Puts `what` into the queue of a
randomly chosen worker
.
/// Puts `what` into the queue of a
worker other than `avoid`
.
virtual
void
enqueue
(
resumable
*
what
)
=
0
;
virtual
void
enqueue
(
resumable
*
what
,
execution_unit
*
avoid
=
nullptr
)
=
0
;
inline
actor_system
&
system
()
{
inline
actor_system
&
system
()
{
return
system_
;
return
system_
;
...
...
libcaf_core/caf/scheduler/coordinator.hpp
View file @
8f7812e6
...
@@ -145,8 +145,8 @@ protected:
...
@@ -145,8 +145,8 @@ protected:
timer_
.
join
();
timer_
.
join
();
}
}
void
enqueue
(
resumable
*
ptr
)
override
{
void
enqueue
(
resumable
*
ptr
,
execution_unit
*
avoid
)
override
{
policy_
.
central_enqueue
(
this
,
ptr
);
policy_
.
central_enqueue
(
this
,
ptr
,
avoid
);
}
}
detail
::
thread_safe_actor_clock
&
clock
()
noexcept
override
{
detail
::
thread_safe_actor_clock
&
clock
()
noexcept
override
{
...
...
libcaf_core/caf/scheduler/test_coordinator.hpp
View file @
8f7812e6
...
@@ -147,7 +147,7 @@ protected:
...
@@ -147,7 +147,7 @@ protected:
void
stop
()
override
;
void
stop
()
override
;
void
enqueue
(
resumable
*
ptr
)
override
;
void
enqueue
(
resumable
*
ptr
,
execution_unit
*
avoid
)
override
;
private:
private:
void
inline_all_enqueues_helper
();
void
inline_all_enqueues_helper
();
...
...
libcaf_core/src/scheduled_actor.cpp
View file @
8f7812e6
...
@@ -166,10 +166,12 @@ void scheduled_actor::enqueue(mailbox_element_ptr ptr, execution_unit* eu) {
...
@@ -166,10 +166,12 @@ void scheduled_actor::enqueue(mailbox_element_ptr ptr, execution_unit* eu) {
CAF_ASSERT
(
private_thread_
!=
nullptr
);
CAF_ASSERT
(
private_thread_
!=
nullptr
);
private_thread_
->
resume
();
private_thread_
->
resume
();
}
else
{
}
else
{
if
(
eu
!=
nullptr
)
// We pull actors towards us for ordinary messages but push them away
// for stream processing.
if
(
eu
!=
nullptr
&&
!
mid
.
is_stream_message
())
eu
->
exec_later
(
this
);
eu
->
exec_later
(
this
);
else
else
home_system
().
scheduler
().
enqueue
(
this
);
home_system
().
scheduler
().
enqueue
(
this
,
eu
);
}
}
break
;
break
;
}
}
...
...
libcaf_core/src/test_coordinator.cpp
View file @
8f7812e6
...
@@ -91,7 +91,7 @@ void test_coordinator::stop() {
...
@@ -91,7 +91,7 @@ void test_coordinator::stop() {
trigger_timeouts
();
trigger_timeouts
();
}
}
void
test_coordinator
::
enqueue
(
resumable
*
ptr
)
{
void
test_coordinator
::
enqueue
(
resumable
*
ptr
,
execution_unit
*
)
{
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
jobs
.
push_back
(
ptr
);
jobs
.
push_back
(
ptr
);
if
(
after_next_enqueue_
!=
nullptr
)
{
if
(
after_next_enqueue_
!=
nullptr
)
{
...
...
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