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
4120e205
Commit
4120e205
authored
Dec 05, 2017
by
Dominik Charousset
Committed by
Dominik Charousset
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow the dynamic WDRR queue to disable queues
parent
ae4d7c58
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
183 additions
and
192 deletions
+183
-192
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+0
-1
libcaf_core/caf/intrusive/wdrr_dynamic_multiplexed_queue.hpp
libcaf_core/caf/intrusive/wdrr_dynamic_multiplexed_queue.hpp
+4
-2
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+0
-1
libcaf_core/test/mock_streaming_classes.cpp
libcaf_core/test/mock_streaming_classes.cpp
+16
-11
libcaf_core/test/streaming_classes.cpp
libcaf_core/test/streaming_classes.cpp
+159
-177
libcaf_core/test/wdrr_dynamic_multiplexed_queue.cpp
libcaf_core/test/wdrr_dynamic_multiplexed_queue.cpp
+4
-0
No files found.
libcaf_core/caf/fwd.hpp
View file @
4120e205
...
@@ -56,7 +56,6 @@ template <class...> class typed_event_based_actor;
...
@@ -56,7 +56,6 @@ template <class...> class typed_event_based_actor;
// -- variadic templates with 1 fixed argument ---------------------------------
// -- variadic templates with 1 fixed argument ---------------------------------
template
<
class
,
class
...>
class
fused_scatterer
;
template
<
class
,
class
...>
class
annotated_stream
;
template
<
class
,
class
...>
class
annotated_stream
;
// -- classes ------------------------------------------------------------------
// -- classes ------------------------------------------------------------------
...
...
libcaf_core/caf/intrusive/wdrr_dynamic_multiplexed_queue.hpp
View file @
4120e205
...
@@ -106,8 +106,10 @@ public:
...
@@ -106,8 +106,10 @@ public:
bool
new_round
(
long
quantum
,
F
&
f
)
{
bool
new_round
(
long
quantum
,
F
&
f
)
{
bool
result
=
false
;
bool
result
=
false
;
for
(
auto
&
kvp
:
qs_
)
{
for
(
auto
&
kvp
:
qs_
)
{
new_round_helper
<
F
>
g
{
kvp
.
first
,
kvp
.
second
,
f
};
if
(
policy_
.
enabled
(
kvp
.
second
))
{
result
|=
g
.
q
.
new_round
(
policy_
.
quantum
(
g
.
q
,
quantum
),
g
);
new_round_helper
<
F
>
g
{
kvp
.
first
,
kvp
.
second
,
f
};
result
|=
g
.
q
.
new_round
(
policy_
.
quantum
(
g
.
q
,
quantum
),
g
);
}
}
}
if
(
!
erase_list_
.
empty
())
{
if
(
!
erase_list_
.
empty
())
{
for
(
auto
&
k
:
erase_list_
)
for
(
auto
&
k
:
erase_list_
)
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
4120e205
...
@@ -41,7 +41,6 @@
...
@@ -41,7 +41,6 @@
#include "caf/stream_stage_impl.hpp"
#include "caf/stream_stage_impl.hpp"
#include "caf/stream_source_impl.hpp"
#include "caf/stream_source_impl.hpp"
#include "caf/stream_result_trait.hpp"
#include "caf/stream_result_trait.hpp"
#include "caf/broadcast_scatterer.hpp"
#include "caf/terminal_stream_scatterer.hpp"
#include "caf/terminal_stream_scatterer.hpp"
#include "caf/to_string.hpp"
#include "caf/to_string.hpp"
...
...
libcaf_core/test/mock_streaming_classes.cpp
View file @
4120e205
...
@@ -258,6 +258,11 @@ struct dmsg_queue_policy : policy_base {
...
@@ -258,6 +258,11 @@ struct dmsg_queue_policy : policy_base {
return
get
<
dmsg
>
(
x
.
content
).
slots
.
receiver
;
return
get
<
dmsg
>
(
x
.
content
).
slots
.
receiver
;
}
}
template
<
class
Queue
>
static
inline
bool
enabled
(
const
Queue
&
)
{
return
true
;
}
template
<
class
Queue
>
template
<
class
Queue
>
deficit_type
quantum
(
const
Queue
&
,
deficit_type
x
)
{
deficit_type
quantum
(
const
Queue
&
,
deficit_type
x
)
{
return
x
;
return
x
;
...
@@ -483,21 +488,21 @@ struct fixture {
...
@@ -483,21 +488,21 @@ struct fixture {
CAF_TEST_FIXTURE_SCOPE
(
mock_streaming_classes_tests
,
fixture
)
CAF_TEST_FIXTURE_SCOPE
(
mock_streaming_classes_tests
,
fixture
)
CAF_TEST
(
simple_handshak
e
)
{
CAF_TEST
(
depth_2_pipelin
e
)
{
bob
.
start_streaming
(
alice
,
30
);
alice
.
start_streaming
(
bob
,
30
);
msg_visitor
f
{
&
alice
};
msg_visitor
f
{
&
bob
};
msg_visitor
g
{
&
bob
};
msg_visitor
g
{
&
alice
};
while
(
!
alice
.
mbox
.
empty
()
||
!
bob
.
mbox
.
empty
())
{
while
(
!
bob
.
mbox
.
empty
()
||
!
alice
.
mbox
.
empty
())
{
alice
.
mbox
.
new_round
(
1
,
f
);
bob
.
mbox
.
new_round
(
1
,
f
);
bob
.
mbox
.
new_round
(
1
,
g
);
alice
.
mbox
.
new_round
(
1
,
g
);
}
}
// Check whether alice and bob cleaned up their state properly.
// Check whether bob and alice cleaned up their state properly.
CAF_CHECK
(
get
<
2
>
(
alice
.
mbox
.
queues
()).
queues
().
empty
());
CAF_CHECK
(
get
<
2
>
(
bob
.
mbox
.
queues
()).
queues
().
empty
());
CAF_CHECK
(
get
<
2
>
(
bob
.
mbox
.
queues
()).
queues
().
empty
());
CAF_CHECK
(
alice
.
pending_managers_
.
empty
());
CAF_CHECK
(
get
<
2
>
(
alice
.
mbox
.
queues
()).
queues
()
.
empty
());
CAF_CHECK
(
bob
.
pending_managers_
.
empty
());
CAF_CHECK
(
bob
.
pending_managers_
.
empty
());
CAF_CHECK
(
alice
.
managers_
.
empty
());
CAF_CHECK
(
alice
.
pending_
managers_
.
empty
());
CAF_CHECK
(
bob
.
managers_
.
empty
());
CAF_CHECK
(
bob
.
managers_
.
empty
());
CAF_CHECK
(
alice
.
managers_
.
empty
());
}
}
CAF_TEST_FIXTURE_SCOPE_END
()
CAF_TEST_FIXTURE_SCOPE_END
()
libcaf_core/test/streaming_classes.cpp
View file @
4120e205
This diff is collapsed.
Click to expand it.
libcaf_core/test/wdrr_dynamic_multiplexed_queue.cpp
View file @
4120e205
...
@@ -89,6 +89,10 @@ struct inode_policy {
...
@@ -89,6 +89,10 @@ struct inode_policy {
return
x
.
value
%
3
;
return
x
.
value
%
3
;
}
}
static
inline
bool
enabled
(
const
queue_type
&
)
{
return
true
;
}
deficit_type
quantum
(
const
queue_type
&
q
,
deficit_type
x
)
{
deficit_type
quantum
(
const
queue_type
&
q
,
deficit_type
x
)
{
return
enable_priorities
&&
*
q
.
policy
().
queue_id
==
0
?
2
*
x
:
x
;
return
enable_priorities
&&
*
q
.
policy
().
queue_id
==
0
?
2
*
x
:
x
;
}
}
...
...
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