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
04dac9d4
Commit
04dac9d4
authored
Jul 11, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'unstable' of github.com:Neverlord/libcppa into unstable
parents
f6157fb1
d5d3b0f6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
46 deletions
+81
-46
CMakeLists.txt
CMakeLists.txt
+50
-27
benchmarks/ActorCreation.scala
benchmarks/ActorCreation.scala
+14
-12
configure
configure
+16
-6
src/binary_deserializer.cpp
src/binary_deserializer.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
04dac9d4
...
@@ -10,34 +10,49 @@ endif ()
...
@@ -10,34 +10,49 @@ endif ()
set
(
CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -Wextra -Wall -pedantic"
)
# Check if the user provided CXXFLAGS on the command line.
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
if
(
CMAKE_CXX_FLAGS
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
"-Os"
)
set
(
CXXFLAGS_PROVIDED true
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O4"
)
ENDIF
()
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O2 -g"
)
if
(
ENABLE_DEBUG
)
if
(
CXXFLAGS_PROVIDED
)
set
(
CMAKE_BUILD_TYPE Debug
)
set
(
CMAKE_CXX_FLAGS_DEBUG
""
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCPPA_DEBUG"
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
""
)
set
(
CMAKE_CXX_FLAGS_RELEASE
""
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
""
)
else
()
else
()
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -Wextra -Wall -pedantic"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
"-Os"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O4"
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O2 -g"
)
endif
()
endif
()
if
(
DISABLE_CONTEXT_SWITCHING
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"GNU"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCPPA_DISABLE_CONTEXT_SWITCHING"
)
endif
()
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"GNU"
)
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
-dumpversion
execute_process
(
COMMAND
${
CMAKE_CXX_COMPILER
}
-dumpversion
OUTPUT_VARIABLE GCC_VERSION
)
OUTPUT_VARIABLE GCC_VERSION
)
if
(
NOT
(
GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7
))
if
(
NOT
(
GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7
))
message
(
FATAL_ERROR
"
${
PROJECT_NAME
}
requires g++ 4.7 or greater."
)
message
(
FATAL_ERROR
"
${
PROJECT_NAME
}
requires g++ 4.7 or greater."
)
endif
()
endif
()
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
elseif
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-stdlib=libc++"
)
if
(
NOT CXXFLAGS_PROVIDED
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-stdlib=libc++"
)
endif
()
else
()
message
(
FATAL_ERROR
"Your C++ compiler does not support C++11."
)
message
(
FATAL_ERROR
"Your C++ compiler does not support C++11."
)
endif
()
endif
()
if
(
ENABLE_DEBUG
)
set
(
CMAKE_BUILD_TYPE Debug
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCPPA_DEBUG"
)
else
()
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
endif
()
if
(
DISABLE_CONTEXT_SWITCHING
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCPPA_DISABLE_CONTEXT_SWITCHING"
)
endif
()
set
(
LIBCPPA_SRC
set
(
LIBCPPA_SRC
src/abstract_tuple.cpp
src/abstract_tuple.cpp
src/actor.cpp
src/actor.cpp
...
@@ -206,22 +221,30 @@ add_dependencies(distributed libcppa)
...
@@ -206,22 +221,30 @@ add_dependencies(distributed libcppa)
add_dependencies
(
matching libcppa
)
add_dependencies
(
matching libcppa
)
string
(
TOUPPER
${
CMAKE_BUILD_TYPE
}
build_type
)
string
(
TOUPPER
${
CMAKE_BUILD_TYPE
}
build_type
)
set
(
CONTEXT_SWITCHING true
)
if
(
DISABLE_CONTEXT_SWITCHING
)
set
(
CONTEXT_SWITCHING false
)
endif
()
message
(
message
(
"
\n
====================| Build Summary |===================="
"
\n
====================| Build Summary |===================="
"
\n
"
"
\n
"
"
\n
Libcppa version:
${
LIBRARY_VERSION
}
"
"
\n
Libcppa version:
${
LIBRARY_VERSION
}
"
"
\n
"
"
\n
Build type:
${
CMAKE_BUILD_TYPE
}
"
"
\n
Debug mode:
${
ENABLE_DEBUG
}
"
"
\n
Context switching:
${
CONTEXT_SWITCHING
}
"
"
\n
"
"
\n
"
"
\n
Source directory:
${
CMAKE_SOURCE_DIR
}
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
Build directory:
${
CMAKE_BINARY_DIR
}
"
"
\n
CXXFLAGS:
${
CMAKE_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS_
${
build_type
}}
"
"
\n
Executable path:
${
EXECUTABLE_OUTPUT_PATH
}
"
"
\n
Library path:
${
LIBRARY_OUTPUT_PATH
}
"
"
\n
Install prefix:
${
CMAKE_INSTALL_PREFIX
}
"
"
\n
Debug mode:
${
ENABLE_DEBUG
}
"
"
\n
"
"
\n
"
"
\n
CXX:
${
CMAKE_CXX_COMPILER
}
"
"
\n
Source directory:
${
CMAKE_SOURCE_DIR
}
"
"
\n
CXXFLAGS:
${
CMAKE_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS_
${
build_type
}}
"
"
\n
Build directory:
${
CMAKE_BINARY_DIR
}
"
"
\n
Executable path:
${
EXECUTABLE_OUTPUT_PATH
}
"
"
\n
Library path:
${
LIBRARY_OUTPUT_PATH
}
"
"
\n
Install prefix:
${
CMAKE_INSTALL_PREFIX
}
"
"
\n
"
"
\n
"
"
\n
Boost:
${
Boost_INCLUDE_DIR
}
"
"
\n
Boost:
${
Boost_INCLUDE_DIR
}
"
"
\n
"
"
\n
"
"
\n
===========================================================
\n
"
"
\n
===========================================================
\n
"
)
)
benchmarks/ActorCreation.scala
View file @
04dac9d4
import
scala.actors.Actor
import
scala.actors.Actor
import
scala.actors.Actor._
import
scala.actors.Actor._
import
akka.actor.
Actor.actorOf
import
akka.actor.
{
Props
,
Actor
=>
AkkaActor
,
ActorRef
=>
AkkaActorRef
,
ActorSystem
}
case
object
GoAhead
case
object
GoAhead
...
@@ -57,37 +57,37 @@ class ThreadlessTestee(parent: Actor) extends Actor {
...
@@ -57,37 +57,37 @@ class ThreadlessTestee(parent: Actor) extends Actor {
}
}
}
}
class
AkkaTestee
(
parent
:
akka.actor.ActorRef
)
extends
akka
.
actor
.
Actor
{
class
AkkaTestee
(
parent
:
AkkaActorRef
)
extends
Akka
Actor
{
def
receive
=
{
def
receive
=
{
case
Spread
(
0
)
=>
case
Spread
(
0
)
=>
parent
!
Result
(
1
)
parent
!
Result
(
1
)
self
.
stop
context
.
stop
(
self
)
case
Spread
(
s
)
=>
case
Spread
(
s
)
=>
val
msg
=
Spread
(
s
-
1
)
val
msg
=
Spread
(
s
-
1
)
actorOf
(
new
AkkaTestee
(
self
)).
start
!
msg
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
msg
actorOf
(
new
AkkaTestee
(
self
)).
start
!
msg
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
msg
become
{
context
.
become
{
case
Result
(
r1
)
=>
case
Result
(
r1
)
=>
become
{
context
.
become
{
case
Result
(
r2
)
=>
case
Result
(
r2
)
=>
parent
!
Result
(
r1
+
r2
)
parent
!
Result
(
r1
+
r2
)
self
.
exit
context
.
stop
(
self
)
}
}
}
}
}
}
}
}
class
AkkaRootTestee
(
n
:
Int
)
extends
akka
.
actor
.
Actor
{
class
AkkaRootTestee
(
n
:
Int
)
extends
Akka
Actor
{
def
receive
=
{
def
receive
=
{
case
GoAhead
=>
case
GoAhead
=>
actorOf
(
new
AkkaTestee
(
self
)).
start
!
Spread
(
n
)
context
.
actorOf
(
Props
(
new
AkkaTestee
(
self
)))
!
Spread
(
n
)
case
Result
(
v
)
=>
case
Result
(
v
)
=>
if
(
v
!=
(
1
<<
n
))
{
if
(
v
!=
(
1
<<
n
))
{
Console
.
println
(
"Expected "
+
(
1
<<
n
)
+
", received "
+
v
)
Console
.
println
(
"Expected "
+
(
1
<<
n
)
+
", received "
+
v
)
System
.
exit
(
42
)
System
.
exit
(
42
)
}
}
global
.
latch
.
countDown
global
.
latch
.
countDown
self
.
exit
context
.
stop
(
self
)
}
}
}
}
...
@@ -122,9 +122,11 @@ object ActorCreation {
...
@@ -122,9 +122,11 @@ object ActorCreation {
}
}
}
}
else
if
(
args
(
0
)
==
"akka"
)
{
else
if
(
args
(
0
)
==
"akka"
)
{
actorOf
(
new
AkkaRootTestee
(
n
)).
start
!
GoAhead
val
system
=
ActorSystem
()
system
.
actorOf
(
Props
(
new
AkkaRootTestee
(
n
)))
!
GoAhead
global
.
latch
.
await
global
.
latch
.
await
}
}
else
usage
else
usage
}
}
}
}
configure
View file @
04dac9d4
...
@@ -17,12 +17,17 @@ usage="\
...
@@ -17,12 +17,17 @@ usage="\
Usage:
$0
[OPTION]... [VAR=VALUE]...
Usage:
$0
[OPTION]... [VAR=VALUE]...
Build Options:
Build Options:
--builddir=DIR place build files in directory [build]
--generator=GENERATOR CMake generator to use (see cmake --help)
--generator=GENERATOR CMake generator to use (see cmake --help)
--with-clang=FILE path to clang++ executable
--build-type=DIR CMake build type: [RelWithDebInfo]
--with-gcc=FILE path to g++ executable
- Debug: debugging flags enabled
- MinSizeRel: minimal output size
- Release: optimizations on, debugging off
- RelWithDebInfo: release flags plus debugging
--build-dir=DIR place build files in directory [build]
--bin-dir=DIR executable directory [build/bin]
--bin-dir=DIR executable directory [build/bin]
--lib-dir=DIR library directory [build/lib]
--lib-dir=DIR library directory [build/lib]
--with-clang=FILE path to clang++ executable
--with-gcc=FILE path to g++ executable
--dual-build build both with gcc and clang
--dual-build build both with gcc and clang
Installation Directories:
Installation Directories:
...
@@ -30,6 +35,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
...
@@ -30,6 +35,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
Optional Features:
Optional Features:
--enable-debug compile in debugging mode
--enable-debug compile in debugging mode
(always sets --build-type=Debug)
--enable-perftools use Google perftools
--enable-perftools use Google perftools
Platform-Dependent Adjustments:
Platform-Dependent Adjustments:
...
@@ -115,6 +121,7 @@ configure ()
...
@@ -115,6 +121,7 @@ configure ()
# Set defaults.
# Set defaults.
builddir
=
"
$sourcedir
/build"
builddir
=
"
$sourcedir
/build"
CMakeCacheEntries
=
""
CMakeCacheEntries
=
""
append_cache_entry CMAKE_BUILD_TYPE STRING RelWithDebInfo
append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local
append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local
append_cache_entry ENABLE_DEBUG BOOL
false
append_cache_entry ENABLE_DEBUG BOOL
false
append_cache_entry DISABLE_CONTEXT_SWITCHING BOOL
false
append_cache_entry DISABLE_CONTEXT_SWITCHING BOOL
false
...
@@ -131,9 +138,6 @@ while [ $# -ne 0 ]; do
...
@@ -131,9 +138,6 @@ while [ $# -ne 0 ]; do
echo
"
${
usage
}
"
1>&2
echo
"
${
usage
}
"
1>&2
exit
1
exit
1
;;
;;
--builddir
=
*
)
builddir
=
$optarg
;;
--generator
=
*
)
--generator
=
*
)
CMakeGenerator
=
"
$optarg
"
CMakeGenerator
=
"
$optarg
"
;;
;;
...
@@ -155,6 +159,12 @@ while [ $# -ne 0 ]; do
...
@@ -155,6 +159,12 @@ while [ $# -ne 0 ]; do
--with-gcc
=
*
)
--with-gcc
=
*
)
gcc
=
$optarg
gcc
=
$optarg
;;
;;
--build-type
=
*
)
append_cache_entry CMAKE_BUILD_TYPE STRING
$optarg
;;
--build-dir
=
*
)
builddir
=
$optarg
;;
--bin-dir
=
*
)
--bin-dir
=
*
)
bindir
=
$optarg
bindir
=
$optarg
;;
;;
...
...
src/binary_deserializer.cpp
View file @
04dac9d4
...
@@ -174,7 +174,7 @@ void binary_deserializer::read_tuple(size_t size,
...
@@ -174,7 +174,7 @@ void binary_deserializer::read_tuple(size_t size,
void
binary_deserializer
::
read_raw
(
size_t
num_bytes
,
void
*
storage
)
{
void
binary_deserializer
::
read_raw
(
size_t
num_bytes
,
void
*
storage
)
{
range_check
(
pos
,
end
,
num_bytes
);
range_check
(
pos
,
end
,
num_bytes
);
memcpy
(
&
storage
,
pos
,
num_bytes
);
memcpy
(
storage
,
pos
,
num_bytes
);
pos
+=
num_bytes
;
pos
+=
num_bytes
;
}
}
...
...
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