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
8bc6aa1c
Commit
8bc6aa1c
authored
Jun 07, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect all default settings in extra header
parent
04ede6c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
191 additions
and
0 deletions
+191
-0
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+1
-0
libcaf_core/caf/defaults.hpp
libcaf_core/caf/defaults.hpp
+89
-0
libcaf_core/src/defaults.cpp
libcaf_core/src/defaults.cpp
+101
-0
No files found.
libcaf_core/CMakeLists.txt
View file @
8bc6aa1c
...
...
@@ -40,6 +40,7 @@ set(LIBCAF_CORE_SRCS
src/config_value.cpp
src/decorated_tuple.cpp
src/default_attachable.cpp
src/defaults.cpp
src/deserializer.cpp
src/downstream_manager.cpp
src/downstream_manager_base.cpp
...
...
libcaf_core/caf/defaults.hpp
0 → 100644
View file @
8bc6aa1c
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
#include <chrono>
#include <cstddef>
#include "caf/atom.hpp"
#include "caf/timestamp.hpp"
// -- hard-coded default values for various CAF options ------------------------
namespace
caf
{
namespace
defaults
{
namespace
streaming
{
extern
const
timespan
desired_batch_complexity
;
extern
const
timespan
max_batch_delay
;
extern
const
timespan
credit_round_interval
;
}
// namespace streaming
namespace
scheduler
{
extern
const
atom_value
policy
;
extern
const
size_t
max_threads
;
extern
const
size_t
max_throughput
;
extern
const
bool
enable_profiling
;
extern
const
timespan
profiling_resolution
;
}
// namespace scheduler
namespace
work_stealing
{
extern
const
size_t
aggressive_poll_attempts
;
extern
const
size_t
aggressive_steal_interval
;
extern
const
size_t
moderate_poll_attempts
;
extern
const
size_t
moderate_steal_interval
;
extern
const
timespan
moderate_sleep_duration
;
extern
const
size_t
relaxed_steal_interval
;
extern
const
timespan
relaxed_sleep_duration
;
}
// namespace work_stealing
namespace
logger
{
extern
const
char
*
file_name
;
extern
const
char
*
file_format
;
extern
const
atom_value
console
;
extern
const
char
*
console_format
;
extern
const
atom_value
verbosity
;
extern
const
bool
inline_output
;
}
// namespace logger
namespace
middleman
{
extern
const
atom_value
network_backend
;
extern
const
bool
enable_automatic_connections
;
extern
const
size_t
max_consecutive_reads
;
extern
const
size_t
heartbeat_interval
;
extern
const
bool
detach_utility_actors
;
extern
const
bool
detach_multiplexer
;
extern
const
bool
enable_tcp
;
extern
const
bool
enable_udp
;
extern
const
size_t
cached_udp_buffers
;
extern
const
size_t
max_pending_msgs
;
}
// namespace middleman
}
// namespace defaults
}
// namespace caf
libcaf_core/src/defaults.cpp
0 → 100644
View file @
8bc6aa1c
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/defaults.hpp"
#include <algorithm>
#include <limits>
#include <thread>
namespace
{
using
us_t
=
std
::
chrono
::
microseconds
;
constexpr
caf
::
timespan
us
(
us_t
::
rep
x
)
{
return
std
::
chrono
::
duration_cast
<
caf
::
timespan
>
(
us_t
{
x
});
}
using
ms_t
=
std
::
chrono
::
milliseconds
;
constexpr
caf
::
timespan
ms
(
ms_t
::
rep
x
)
{
return
std
::
chrono
::
duration_cast
<
caf
::
timespan
>
(
ms_t
{
x
});
}
}
// namespace <anonymous>
namespace
caf
{
namespace
defaults
{
namespace
streaming
{
const
timespan
desired_batch_complexity
=
us
(
50
);
const
timespan
max_batch_delay
=
ms
(
5
);
const
timespan
credit_round_interval
=
ms
(
10
);
}
// namespace streaming
namespace
scheduler
{
const
atom_value
policy
=
atom
(
"stealing"
);
const
size_t
max_threads
=
std
::
max
(
std
::
thread
::
hardware_concurrency
(),
4u
);
const
size_t
max_throughput
=
std
::
numeric_limits
<
size_t
>::
max
();
const
bool
enable_profiling
=
false
;
const
timespan
profiling_resolution
=
ms
(
100
);
}
// namespace scheduler
namespace
work_stealing
{
const
size_t
aggressive_poll_attempts
=
100
;
const
size_t
aggressive_steal_interval
=
10
;
const
size_t
moderate_poll_attempts
=
500
;
const
size_t
moderate_steal_interval
=
5
;
const
timespan
moderate_sleep_duration
=
us
(
50
);
const
size_t
relaxed_steal_interval
=
1
;
const
timespan
relaxed_sleep_duration
=
ms
(
10
);
}
// namespace work_stealing
namespace
logger
{
const
char
*
file_name
=
"actor_log_[PID]_[TIMESTAMP]_[NODE].log"
;
const
char
*
file_format
=
"%r %c %p %a %t %C %M %F:%L %m%n"
;
const
atom_value
console
=
atom
(
"none"
);
const
char
*
console_format
=
"%m"
;
const
atom_value
verbosity
=
atom
(
"trace"
);
const
bool
inline_output
=
false
;
}
// namespace logger
namespace
middleman
{
const
atom_value
network_backend
=
atom
(
"default"
);
const
bool
enable_automatic_connections
=
false
;
const
size_t
max_consecutive_reads
=
50
;
const
size_t
heartbeat_interval
=
0
;
const
bool
detach_utility_actors
=
true
;
const
bool
detach_multiplexer
=
true
;
const
bool
enable_tcp
=
true
;
const
bool
enable_udp
=
false
;
const
size_t
cached_udp_buffers
=
10
;
const
size_t
max_pending_msgs
=
10
;
}
// namespace middleman
}
// namespace defaults
}
// namespace caf
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