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
b6a31c78
Commit
b6a31c78
authored
Nov 16, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix credit calculation
parent
43cac8bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
libcaf_core/src/inbound_path.cpp
libcaf_core/src/inbound_path.cpp
+2
-3
No files found.
libcaf_core/src/inbound_path.cpp
View file @
b6a31c78
...
@@ -115,11 +115,10 @@ void inbound_path::emit_ack_batch(local_actor* self, int32_t queued_items,
...
@@ -115,11 +115,10 @@ void inbound_path::emit_ack_batch(local_actor* self, int32_t queued_items,
timespan
cycle
,
timespan
complexity
)
{
timespan
cycle
,
timespan
complexity
)
{
CAF_LOG_TRACE
(
CAF_ARG
(
slots
)
<<
CAF_ARG
(
queued_items
)
<<
CAF_ARG
(
cycle
)
CAF_LOG_TRACE
(
CAF_ARG
(
slots
)
<<
CAF_ARG
(
queued_items
)
<<
CAF_ARG
(
cycle
)
<<
CAF_ARG
(
complexity
));
<<
CAF_ARG
(
complexity
));
CAF_IGNORE_UNUSED
(
queued_items
);
auto
x
=
stats
.
calculate
(
cycle
,
complexity
);
auto
x
=
stats
.
calculate
(
cycle
,
complexity
);
// Hand out enough credit to fill our queue for 2 cycles.
// Hand out enough credit to fill our queue for 2 cycles.
auto
credit
=
std
::
max
((
x
.
max_throughput
*
2
)
auto
credit
=
std
::
max
((
x
.
max_throughput
*
2
)
-
assigned_credit
,
0
);
-
(
assigned_credit
+
queued_items
),
0
);
// Protect against overflow on `assigned_credit`.
// Protect against overflow on `assigned_credit`.
auto
max_new_credit
=
std
::
numeric_limits
<
int32_t
>::
max
()
-
assigned_credit
;
auto
max_new_credit
=
std
::
numeric_limits
<
int32_t
>::
max
()
-
assigned_credit
;
// The manager can restrict or adjust the amount of credit.
// The manager can restrict or adjust the amount of credit.
...
...
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