diff --git a/.gitignore b/.gitignore
index 1cb6a72785..3c47370786 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,64 +1,14 @@
-html/
-.DS_Store
-*.o
-*.dylib
-test
-*.png
-*.dat
-*.ii
-*.s
-*.tmp
-*.la
-*.lo
-*.dump
*.beam
*.class
-benchmarks/mailbox_performance
-benchmarks/actor_creation
-benchmarks/mixed_case
-benchmarks/matching
-theron_mailbox_performance
-.libs/
-.deps/
-libcppa.pc
-Makefile.in
-aclocal.m4
-autom4te.cache/
-gen_server/parallel_send
-gen_server/sequential_send
-gen_server/test.dSYM/
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-unit_testing/Makefile.in
-unit_testing/unit_tests
-unit_testing/.deps/
-config.*
-configure
-INSTALL
-m4/libtool.m4
-m4/lt*.m4
-a.out*
-queue_test
-cppa.creator.user
-8threads
-4threads
-libcppa.Makefile
-variadic_templates_test
-variadic_templates_test.dSYM/
-Makefile
-unit_testing/Makefile
-libcppa.so*
-blob/cppatest
+*.dat
+*.dump
+*.png
+*.tmp
+.DS_Store
callgrind.out*
-examples/announce_example_1
-examples/announce_example_2
-examples/announce_example_3
-examples/announce_example_4
-examples/announce_example_5
-examples/hello_world_example
-examples/math_actor_example
-examples/dining_philosophers
-examples/dancing_kirby
+cppa.creator.user
+html/
+libcppa.pc
+bin/*
+build/*
+lib/*
diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..4f5860b278
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,177 @@
+cmake_minimum_required(VERSION 2.4)
+project(cppa CXX)
+
+set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wextra -Wall -pedantic")
+
+set(LIBCPPA_SRC
+ src/abstract_tuple.cpp
+ src/actor.cpp
+ src/actor_count.cpp
+ src/actor_proxy.cpp
+ src/actor_proxy_cache.cpp
+ src/actor_registry.cpp
+ src/addressed_message.cpp
+ src/any_tuple.cpp
+ src/atom.cpp
+ src/attachable.cpp
+ src/behavior_stack.cpp
+ src/binary_deserializer.cpp
+ src/binary_serializer.cpp
+ src/channel.cpp
+ src/thread_mapped_actor.cpp
+ src/demangle.cpp
+ src/deserializer.cpp
+ src/duration.cpp
+ src/empty_tuple.cpp
+ src/event_based_actor.cpp
+ src/exception.cpp
+ src/factory.cpp
+ src/fiber.cpp
+ src/group.cpp
+ src/group_manager.cpp
+ src/local_actor.cpp
+ src/mailman.cpp
+ src/native_socket.cpp
+ src/network_manager.cpp
+ src/object.cpp
+ src/object_array.cpp
+ src/partial_function.cpp
+ src/pattern.cpp
+ src/post_office.cpp
+ src/primitive_variant.cpp
+ src/process_information.cpp
+ src/receive.cpp
+ src/ripemd_160.cpp
+ src/scheduled_actor.cpp
+ src/scheduled_actor_dummy.cpp
+ src/scheduler.cpp
+ src/self.cpp
+ src/serializer.cpp
+ src/shared_spinlock.cpp
+ src/singleton_manager.cpp
+ src/string_serialization.cpp
+ src/thread_pool_scheduler.cpp
+ src/to_uniform_name.cpp
+ src/unicast_network.cpp
+ src/uniform_type_info.cpp
+ src/yield_interface.cpp
+ src/context_switching_actor.cpp
+)
+
+set(boost_context third_party/boost_context/)
+
+# add third_party boost_context sources
+if(APPLE)
+ set_property(SOURCE
+ ${boost_context}/src/asm/fcontext_x86_64_sysv_macho_gas.S
+ PROPERTY LANGUAGE CXX)
+ set(LIBCPPA_SRC
+ ${LIBCPPA_SRC}
+ ${boost_context}/src/stack_utils_posix.cpp
+ ${boost_context}/src/stack_allocator_posix.cpp
+ ${boost_context}/src/fcontext.cpp
+ ${boost_context}/src/asm/fcontext_x86_64_sysv_macho_gas.S
+ )
+elseif(UNIX)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set_property(SOURCE
+ ${boost_context}/src/asm/fcontext_i386_sysv_elf_gas.S
+ PROPERTY LANGUAGE CXX)
+ set(fcontext_asm ${boost_context}/src/asm/fcontext_i386_sysv_elf_gas.S)
+ else()
+ set_property(SOURCE
+ ${boost_context}/src/asm/fcontext_x86_64_sysv_elf_gas.S
+ PROPERTY LANGUAGE CXX)
+ set(fcontext_asm ${boost_context}/src/asm/fcontext_x86_64_sysv_elf_gas.S)
+ endif()
+ set(LIBCPPA_SRC
+ ${LIBCPPA_SRC}
+ ${fcontext_asm}
+ ${boost_context}/src/stack_utils_posix.cpp
+ ${boost_context}/src/stack_allocator_posix.cpp
+ ${boost_context}/src/fcontext.cpp
+ )
+endif()
+
+find_package(Boost COMPONENTS thread REQUIRED)
+
+link_directories(${Boost_LIBRARY_DIRS})
+include_directories(. ${Boost_INCLUDE_DIRS} ${boost_context}/include)
+
+add_library(libcppa SHARED ${LIBCPPA_SRC})
+
+target_link_libraries(libcppa ${CMAKE_LD_LIBS} ${Boost_THREAD_LIBRARY})
+
+set(LIBCPPA_VERSION_MAJOR 0)
+set(LIBCPPA_VERSION_MINOR 2)
+set(LIBCPPA_VERSION_PATCH 0)
+set(LIBRARY_VERSION ${LIBCPPA_VERSION_MAJOR}.${LIBCPPA_VERSION_MINOR}.${LIBCPPA_VERSION_PATCH})
+set(LIBRARY_SOVERSION ${LIBCPPA_VERSION_MAJOR})
+
+set_target_properties(libcppa PROPERTIES SOVERSION ${LIBRARY_SOVERSION} VERSION ${LIBRARY_VERSION} OUTPUT_NAME cppa)
+install(TARGETS libcppa LIBRARY DESTINATION lib)
+
+# install includes
+install(DIRECTORY cppa/ DESTINATION include/cppa
+ FILES_MATCHING PATTERN "*.hpp")
+# uninstall target
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY)
+
+add_custom_target(uninstall
+ COMMAND ${CMAKE_COMMAND} -P
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+
+
+
+if (LIBRARY_OUTPUT_PATH)
+ set (CPPA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
+ set (CPPA_LIBRARY_PATH ${LIBRARY_OUTPUT_PATH})
+else()
+ set (CPPA_LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
+ set (CPPA_LIBRARY_PATH ${CPPA_LIBRARY_OUTPUT_PATH})
+ set (LIBRARY_OUTPUT_PATH ${CPPA_LIBRARY_OUTPUT_PATH} CACHE PATH "Single directory for all libraries")
+endif()
+
+# setting path to cppa headers and libcppa
+set (CPPA_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/libcppa)
+set (CPPA_INCLUDE ${CPPA_INCLUDE_PATH})
+
+if (APPLE)
+ set (CPPA_LIBRARY ${LIBRARY_OUTPUT_PATH}/libcppa.dylib)
+elseif (UNIX)
+ set (CPPA_LIBRARY ${LIBRARY_OUTPUT_PATH}/libcppa.so)
+else ()
+ message (SEND_FATAL "Host platform not supported ...")
+endif ()
+
+if (EXECUTABLE_OUTPUT_PATH)
+else ()
+ set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin CACHE PATH "Single directory for all executables")
+endif ()
+
+add_subdirectory(unit_testing)
+add_subdirectory(examples)
+add_subdirectory(benchmarks)
+#add_subdirectory(benchmarks)
+#add_dependencies(unit_tests libcppa)
+#add_dependencies(benchmarks libcppa)
+add_dependencies(announce_example_1 libcppa)
+add_dependencies(announce_example_2 libcppa)
+add_dependencies(announce_example_3 libcppa)
+add_dependencies(announce_example_4 libcppa)
+add_dependencies(announce_example_5 libcppa)
+add_dependencies(dancing_kirby libcppa)
+add_dependencies(dining_philosophers libcppa)
+add_dependencies(hello_world_example libcppa)
+add_dependencies(math_actor_example libcppa)
+add_dependencies(unit_tests libcppa)
+add_dependencies(actor_creation libcppa)
+add_dependencies(mailbox_performance libcppa)
+add_dependencies(mixed_case libcppa)
+add_dependencies(distributed libcppa)
+add_dependencies(matching libcppa)
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 94a9ed024d..0000000000
--- a/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/ChangeLog b/ChangeLog
index e69de29bb2..bc8a53ff41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -0,0 +1,12 @@
+Version 0.2
+
+2012-06-29
+
+- Removed become_void() [use quit() instead]
+- Renamed "future_send()" to "delayed_send()"
+- Removed "stacked_actor"; moved functionality to "event_based_actor"
+- Renamed "fsm_actor" to "sb_actor"
+- Refactored "spawn": spawn(new T(...)) => spawn(...)
+- Implemented become()/unbecome() for context-switching & thread-mapped actors
+- Moved become()/unbecome() to local_actor
+- Ported libcppa from to Boost.Context library
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index e93ca0902e..0000000000
--- a/Makefile.am
+++ /dev/null
@@ -1,234 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4
-
-lib_LTLIBRARIES = libcppa.la
-
-libcppa_la_SOURCES = \
- src/abstract_event_based_actor.cpp \
- src/abstract_scheduled_actor.cpp \
- src/abstract_tuple.cpp \
- src/actor.cpp \
- src/actor_count.cpp \
- src/actor_proxy.cpp \
- src/actor_proxy_cache.cpp \
- src/actor_registry.cpp \
- src/addressed_message.cpp \
- src/any_tuple.cpp \
- src/atom.cpp \
- src/attachable.cpp \
- src/binary_deserializer.cpp \
- src/binary_serializer.cpp \
- src/channel.cpp \
- src/converted_thread_context.cpp \
- src/cppa.cpp \
- src/demangle.cpp \
- src/deserializer.cpp \
- src/duration.cpp \
- src/empty_tuple.cpp \
- src/event_based_actor.cpp \
- src/exception.cpp \
- src/fiber.cpp \
- src/group.cpp \
- src/group_manager.cpp \
- src/invokable.cpp \
- src/local_actor.cpp \
- src/mailman.cpp \
- src/mock_scheduler.cpp \
- src/native_socket.cpp \
- src/network_manager.cpp \
- src/object.cpp \
- src/object_array.cpp \
- src/partial_function.cpp \
- src/pattern.cpp \
- src/post_office.cpp \
- src/post_office_msg.cpp \
- src/primitive_variant.cpp \
- src/process_information.cpp \
- src/receive.cpp \
- src/ripemd_160.cpp \
- src/scheduled_actor.cpp \
- src/scheduler.cpp \
- src/self.cpp \
- src/serializer.cpp \
- src/shared_spinlock.cpp \
- src/singleton_manager.cpp \
- src/stacked_event_based_actor.cpp \
- src/string_serialization.cpp \
- src/thread_pool_scheduler.cpp \
- src/to_uniform_name.cpp \
- src/unicast_network.cpp \
- src/uniform_type_info.cpp \
- src/yield_interface.cpp \
- src/yielding_actor.cpp
-
-if VERSIONED_INCLUDE_DIR
-library_includedir = $(includedir)/cppa/$(PACKAGE_VERSION)/
-else
-library_includedir = $(includedir)/
-endif
-
-nobase_library_include_HEADERS = \
- cppa/abstract_actor.hpp \
- cppa/abstract_event_based_actor.hpp \
- cppa/actor.hpp \
- cppa/actor_proxy.hpp \
- cppa/announce.hpp \
- cppa/any_tuple.hpp \
- cppa/anything.hpp \
- cppa/atom.hpp \
- cppa/attachable.hpp \
- cppa/behavior.hpp \
- cppa/binary_deserializer.hpp \
- cppa/binary_serializer.hpp \
- cppa/channel.hpp \
- cppa/config.hpp \
- cppa/cow_ptr.hpp \
- cppa/cow_tuple.hpp \
- cppa/cppa.hpp \
- cppa/deserializer.hpp \
- cppa/detail/abstract_scheduled_actor.hpp \
- cppa/detail/abstract_tuple.hpp \
- cppa/detail/actor_count.hpp \
- cppa/detail/actor_proxy_cache.hpp \
- cppa/detail/actor_registry.hpp \
- cppa/detail/addressed_message.hpp \
- cppa/detail/atom_val.hpp \
- cppa/detail/boxed.hpp \
- cppa/detail/buffer.hpp \
- cppa/detail/channel.hpp \
- cppa/detail/container_tuple_view.hpp \
- cppa/detail/converted_thread_context.hpp \
- cppa/detail/decorated_tuple.hpp \
- cppa/detail/default_uniform_type_info_impl.hpp \
- cppa/detail/demangle.hpp \
- cppa/detail/disablable_delete.hpp \
- cppa/detail/empty_tuple.hpp \
- cppa/detail/get_behavior.hpp \
- cppa/detail/group_manager.hpp \
- cppa/detail/implicit_conversions.hpp \
- cppa/detail/invokable.hpp \
- cppa/detail/list_member.hpp \
- cppa/detail/mailman.hpp \
- cppa/detail/map_member.hpp \
- cppa/detail/matches.hpp \
- cppa/detail/mock_scheduler.hpp \
- cppa/detail/native_socket.hpp \
- cppa/detail/network_manager.hpp \
- cppa/detail/object_array.hpp \
- cppa/detail/object_impl.hpp \
- cppa/detail/pair_member.hpp \
- cppa/detail/post_office.hpp \
- cppa/detail/post_office_msg.hpp \
- cppa/detail/primitive_member.hpp \
- cppa/detail/projection.hpp \
- cppa/detail/pseudo_tuple.hpp \
- cppa/detail/ptype_to_type.hpp \
- cppa/detail/receive_loop_helper.hpp \
- cppa/detail/ref_counted_impl.hpp \
- cppa/detail/serialize_tuple.hpp \
- cppa/detail/singleton_manager.hpp \
- cppa/detail/swap_bytes.hpp \
- cppa/detail/tdata.hpp \
- cppa/detail/thread.hpp \
- cppa/detail/thread_pool_scheduler.hpp \
- cppa/detail/to_uniform_name.hpp \
- cppa/detail/tuple_cast_impl.hpp \
- cppa/detail/tuple_iterator.hpp \
- cppa/detail/tuple_vals.hpp \
- cppa/detail/tuple_view.hpp \
- cppa/detail/type_to_ptype.hpp \
- cppa/detail/types_array.hpp \
- cppa/detail/unboxed.hpp \
- cppa/detail/uniform_type_info_map.hpp \
- cppa/detail/value_guard.hpp \
- cppa/detail/yield_interface.hpp \
- cppa/detail/yielding_actor.hpp \
- cppa/either.hpp \
- cppa/event_based_actor.hpp \
- cppa/event_based_actor_base.hpp \
- cppa/exception.hpp \
- cppa/exit_reason.hpp \
- cppa/from_string.hpp \
- cppa/fsm_actor.hpp \
- cppa/get.hpp \
- cppa/group.hpp \
- cppa/guard_expr.hpp \
- cppa/intrusive/forward_iterator.hpp \
- cppa/intrusive/single_reader_queue.hpp \
- cppa/intrusive/singly_linked_list.hpp \
- cppa/intrusive_ptr.hpp \
- cppa/local_actor.hpp \
- cppa/match.hpp \
- cppa/match_expr.hpp \
- cppa/object.hpp \
- cppa/on.hpp \
- cppa/option.hpp \
- cppa/partial_function.hpp \
- cppa/pattern.hpp \
- cppa/primitive_type.hpp \
- cppa/primitive_variant.hpp \
- cppa/process_information.hpp \
- cppa/receive.hpp \
- cppa/ref_counted.hpp \
- cppa/scheduled_actor.hpp \
- cppa/scheduler.hpp \
- cppa/scheduling_hint.hpp \
- cppa/self.hpp \
- cppa/serializer.hpp \
- cppa/stacked_event_based_actor.hpp \
- cppa/to_string.hpp \
- cppa/tpartial_function.hpp \
- cppa/tuple_cast.hpp \
- cppa/type_value_pair.hpp \
- cppa/uniform_type_info.hpp \
- cppa/util/abstract_uniform_type_info.hpp \
- cppa/util/apply_args.hpp \
- cppa/util/apply_tuple.hpp \
- cppa/util/arg_match_t.hpp \
- cppa/util/at.hpp \
- cppa/util/callable_trait.hpp \
- cppa/util/comparable.hpp \
- cppa/util/compare_tuples.hpp \
- cppa/util/conjunction.hpp \
- cppa/util/deduce_ref_type.hpp \
- cppa/util/disjunction.hpp \
- cppa/util/duration.hpp \
- cppa/util/element_at.hpp \
- cppa/util/fiber.hpp \
- cppa/util/fixed_vector.hpp \
- cppa/util/if_else.hpp \
- cppa/util/is_array_of.hpp \
- cppa/util/is_builtin.hpp \
- cppa/util/is_comparable.hpp \
- cppa/util/is_forward_iterator.hpp \
- cppa/util/is_iterable.hpp \
- cppa/util/is_legal_tuple_type.hpp \
- cppa/util/is_manipulator.hpp \
- cppa/util/is_mutable_ref.hpp \
- cppa/util/is_primitive.hpp \
- cppa/util/left_or_right.hpp \
- cppa/util/producer_consumer_list.hpp \
- cppa/util/projection.hpp \
- cppa/util/pt_dispatch.hpp \
- cppa/util/pt_token.hpp \
- cppa/util/purge_refs.hpp \
- cppa/util/replace_type.hpp \
- cppa/util/ripemd_160.hpp \
- cppa/util/rm_option.hpp \
- cppa/util/rm_ref.hpp \
- cppa/util/shared_lock_guard.hpp \
- cppa/util/shared_spinlock.hpp \
- cppa/util/static_foreach.hpp \
- cppa/util/tbind.hpp \
- cppa/util/type_list.hpp \
- cppa/util/type_pair.hpp \
- cppa/util/upgrade_lock_guard.hpp \
- cppa/util/void_type.hpp \
- cppa/util/wrapped.hpp
-
-libcppa_la_CXXFLAGS = --std=c++0x -pedantic -Wall -Wextra
-libcppa_la_LDFLAGS = -release $(PACKAGE_VERSION) $(BOOST_CPPFLAGS)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libcppa.pc
-
-SUBDIRS = . unit_testing examples benchmarks
diff --git a/NEWS b/NEWS
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/README b/README
deleted file mode 100644
index 64e458a847..0000000000
--- a/README
+++ /dev/null
@@ -1,15 +0,0 @@
-Blog: http://libcppa.blogspot.com
-
-This project is in an early / experimental stage.
-
-It makes use of variadic templates, unrestricted unions,
-type inference and other C++11 features.
-Thus, GCC in version >= 4.6 is required to compile libcppa.
-You'll also need automake and the boost thread library.
-
-
-Building libcppa:
-
-* autoreconf -i
-* ./configure
-* make
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..88d6e4fa8b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,58 @@
+libcppa
+=======
+
+libcppa is an LGPL C++11 actor model implementation featuring lightweight & fast
+actor implementations, pattern matching for messages,
+network transparent messaging, and more.
+
+
+On the Web
+----------
+
+* __Blog__: http://libcppa.blogspot.com
+* __Manual__: http://neverlord.github.com/libcppa/manual/
+* __Documentation__: http://neverlord.github.com/libcppa/
+* __Project Homepage__: http://www.realmv6.org/libcppa.html
+
+Get the Sources
+---------------
+
+* git clone git://github.com/Neverlord/libcppa.git
+* cd libcppa
+
+
+First Steps
+-----------
+
+* mkdir build
+* cd build
+* cmake ..
+* make
+
+It is recommended to run the unit tests as well.
+
+* ./bin/unit_tests
+
+Please submit a bug report that includes (a) your compiler version, (b) your OS,
+and (c) the output of the unit tests if an error occurs.
+
+
+Dependencies
+------------
+
+* CMake
+* The Boost Library
+
+
+Supported Compilers
+-------------------
+
+* GCC >= 4.7
+* Clang >= 3.2
+
+
+Supported Operating Systems
+---------------------------
+
+* Linux
+* Mac OS X
diff --git a/benchmarks/ActorCreation.scala b/benchmarks/ActorCreation.scala
index 3aaf1441b7..cfd9becdbf 100644
--- a/benchmarks/ActorCreation.scala
+++ b/benchmarks/ActorCreation.scala
@@ -104,14 +104,12 @@ object ActorCreation {
if (args(0) == "threaded") {
val newMax = (1 << n) + 100
System.setProperty("actors.maxPoolSize", newMax.toString)
- //actor {
- (new ThreadedTestee(self)).start ! Spread(n)
- receive {
- case Result(v) =>
- if (v != (1 << n))
- Console.println("ERROR: expected " + (1 << n) + ", received " + v)
- }
- //}
+ (new ThreadedTestee(self)).start ! Spread(n)
+ receive {
+ case Result(v) =>
+ if (v != (1 << n))
+ Console.println("ERROR: expected " + (1 << n) + ", received " + v)
+ }
}
else if (args(0) == "threadless") {
actor {
diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
new file mode 100644
index 0000000000..12c2a6fe13
--- /dev/null
+++ b/benchmarks/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 2.6)
+project(cppa_benchmarks CXX)
+
+# Set up environment paths to cmake modules and libcppa
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
+
+add_executable(actor_creation actor_creation.cpp)
+add_executable(mailbox_performance mailbox_performance.cpp)
+add_executable(mixed_case mixed_case.cpp)
+add_executable(distributed distributed.cpp)
+add_executable(matching matching.cpp)
+
+# search for libs
+if(NOT cppa_LIBRARY)
+ find_package(Libcppa REQUIRED)
+endif (NOT cppa_LIBRARY)
+
+find_package(Boost COMPONENTS thread REQUIRED)
+
+link_directories(${Boost_LIBRARY_DIRS})
+include_directories(. ${cppa_INCLUDE} ${Boost_INCLUDE_DIRS})
+
+set(benchmark_LIBS ${CMAKE_DL_LIBS} ${CPPA_LIBRARY} ${Boost_THREAD_LIBRARY})
+
+target_link_libraries(actor_creation ${benchmark_LIBS})
+target_link_libraries(mailbox_performance ${benchmark_LIBS})
+target_link_libraries(mixed_case ${benchmark_LIBS})
+target_link_libraries(distributed ${benchmark_LIBS})
+target_link_libraries(matching ${benchmark_LIBS})
diff --git a/benchmarks/Distributed.scala b/benchmarks/Distributed.scala
new file mode 100644
index 0000000000..d54e3353af
--- /dev/null
+++ b/benchmarks/Distributed.scala
@@ -0,0 +1,374 @@
+import scala.actors._
+import scala.actors.Actor.self
+import scala.actors.remote.RemoteActor
+import scala.actors.remote.RemoteActor.{alive, select, register}
+import scala.actors.remote.Node
+import scala.actors.TIMEOUT
+
+import akka.actor.{ Props, Actor => AkkaActor, ActorRef => AkkaActorRef, ActorSystem }
+import com.typesafe.config.ConfigFactory
+
+import scala.annotation.tailrec
+import Console.println
+
+case class Ping(value: Int)
+case class Pong(value: Int)
+case class KickOff(value: Int)
+
+case object Done
+case class Ok(token: String)
+case class Hello(token: String)
+case class Olleh(token: String)
+case class Error(msg: String, token: String)
+case class AddPong(path: String, token: String)
+
+case class AddPongTimeout(path: String, token: String)
+
+object global {
+ val latch = new java.util.concurrent.CountDownLatch(1)
+}
+
+trait ServerActorPrototype[T] {
+
+ protected def reply(what: Any): Unit
+ protected def kickOff(old: T, value: Int): Unit
+ protected def connectionEstablished(peers: T, pending: Any): T
+ protected def newPending(peers: T, path: String, token: String) : T
+ protected def handleTimeout(peers: T): (Boolean, T) = throw new RuntimeException("unsupported timeout")
+ protected def handleAddPongTimeout(peers: T, path: String, token: String): (Boolean, T) = throw new RuntimeException("unsupported timeout")
+
+ def recvFun(peers: T { def connected: List[{ def path: String }]; def pending: List[{ def clientToken: String }] }): PartialFunction[Any, (Boolean, T)] = {
+ case Ping(value) => reply(Pong(value)); (false, peers)
+ case Hello(token) => reply(Olleh(token)); (false, peers)
+ case Olleh(token) => peers.pending find (_.clientToken == token) match {
+ case Some(x) => (true, connectionEstablished(peers, x))
+ case None => (false, peers)
+ }
+ case AddPong(path, token) => {
+ //println("received AddPong(" + path + ", " + token + ")")
+ if (peers.connected exists (_.path == path)) {
+ reply(Ok(token))
+ //println("recv[" + peers + "]: " + path + " cached (replied 'Ok')")
+ (false, peers)
+ }
+ else {
+ try { (true, newPending(peers, path, token)) }
+ catch {
+ // catches match error and integer conversion failure
+ case e => reply(Error(e.toString, token)); (false, peers)
+ }
+ }
+ }
+ case KickOff(value) => kickOff(peers, value); (false, peers)
+ case AddPongTimeout(path, token) => handleAddPongTimeout(peers, path, token)
+ case TIMEOUT => handleTimeout(peers)
+ }
+}
+
+case class RemoteActorPath(uri: String, host: String, port: Int)
+
+class PingActor(parent: OutputChannel[Any], pongs: List[OutputChannel[Any]]) extends Actor {
+
+ private var left = pongs.length
+
+ private def recvLoop: Nothing = react {
+ case Pong(0) => {
+ parent ! Done
+ if (left > 1) {
+ left -= 1
+ recvLoop
+ }
+ }
+ case Pong(value) => sender ! Ping(value - 1); recvLoop
+ }
+
+ override def act() = react {
+ case KickOff(value) => pongs.foreach(_ ! Ping(value)); recvLoop
+ }
+}
+
+case class Peer(path: String, channel: OutputChannel[Any])
+case class PendingPeer(path: String, channel: OutputChannel[Any], client: OutputChannel[Any], clientToken: String)
+case class Peers(connected: List[Peer], pending: List[PendingPeer])
+
+class ServerActor(port: Int) extends Actor with ServerActorPrototype[Peers] {
+
+ //def reply(what: Any): Unit = sender ! what // inherited from ReplyReactor
+
+ protected override def kickOff(peers: Peers, value: Int) = {
+ (new PingActor(sender, peers.connected map (_.channel))).start ! KickOff(value)
+ }
+
+ protected override def connectionEstablished(peers: Peers, x: Any) = x match {
+ case PendingPeer(path, channel, client, token) => {
+ client ! Ok(token)
+ Peers(Peer(path, channel) :: peers.connected, peers.pending filterNot (_.clientToken == token))
+ }
+ }
+
+ protected def newPending(peers: Peers, path: String, token: String) : Peers = path split ":" match {
+ case Array(node, port) => {
+ val channel = select(new Node(node, port.toInt), 'Pong)
+ channel ! Hello(token)
+ //println("recv[" + peers + "]: sent 'Hello' to " + path)
+ Peers(peers.connected, PendingPeer(path, channel, sender, token) :: peers.pending)
+ }
+ }
+
+ protected override def handleTimeout(peers: Peers) = {
+ peers.pending foreach (x => x.client ! Error("cannot connect to " + x.path, x.clientToken))
+ (true, Peers(peers.connected, Nil))
+ }
+
+ override def act() {
+ RemoteActor classLoader = getClass().getClassLoader
+ alive(port)
+ register('Pong, self)
+ @tailrec def recvLoop(peers: Peers): Nothing = {
+ def recv(peers: Peers, receiveFun: PartialFunction[Any, (Boolean, Peers)] => (Boolean, Peers)): Peers = receiveFun(recvFun(peers))._2
+ recvLoop(recv(peers, if (peers.pending isEmpty) receive else receiveWithin(5000)))
+ }
+ recvLoop(Peers(Nil, Nil))
+ }
+
+}
+
+class ClientActor(pongPaths: List[RemoteActorPath], numPings: Int) extends Actor {
+ override def act() = {
+ RemoteActor classLoader = getClass().getClassLoader
+ val pongs = pongPaths map (x => {
+ val pong = select(new Node(x.host, x.port), 'Pong)
+ pongPaths foreach (y => if (x != y) pong ! AddPong(y.uri, x.uri + " -> " + y.uri))
+ pong
+ })
+ @tailrec def collectOkMessages(left: Int, receivedTokens: List[String]): Unit = {
+ if (left > 0)
+ collectOkMessages(left - 1, receiveWithin(10000) {
+ case Ok(token) => token :: receivedTokens
+ case Error(msg, token) => throw new RuntimeException("connection failed: " + token + ", message from server: " + msg)
+ case TIMEOUT => throw new RuntimeException("no Ok within 10sec.\nreceived tokens:\n" + receivedTokens.sortWith(_.compareTo(_) < 0).mkString("\n"))
+ })
+ }
+ collectOkMessages(pongs.length * (pongs.length - 1), Nil)
+ // kickoff
+ pongs foreach (_ ! KickOff(numPings))
+ // collect done messages
+ for (_ <- 1 until (pongs.length * (pongs.length - 1))) {
+ receiveWithin(30*60*1000) {
+ case Done => Unit
+ case TIMEOUT => throw new RuntimeException("no Done within 30min")
+ case x => throw new RuntimeException("Unexpected message: " + x.toString)
+ }
+ }
+ }
+}
+
+case class SetParent(parent: AkkaActorRef)
+
+class AkkaPingActor(pongs: List[AkkaActorRef]) extends AkkaActor {
+
+ import context.become
+
+ private var parent: AkkaActorRef = null
+ private var left = pongs.length
+
+ private def recvLoop: Receive = {
+ case Pong(0) => {
+ parent ! Done
+ //println(parent.toString + " ! Done")
+ if (left > 1) left -= 1
+ else context.stop(self)
+ }
+ case Pong(value) => sender ! Ping(value - 1)
+ }
+
+ def receive = {
+ case SetParent(p) => parent = p
+ case KickOff(value) => pongs.foreach(_ ! Ping(value)); become(recvLoop)
+ }
+}
+
+case class AkkaPeer(path: String, channel: AkkaActorRef)
+case class PendingAkkaPeer(path: String, channel: AkkaActorRef, client: AkkaActorRef, clientToken: String)
+case class AkkaPeers(connected: List[AkkaPeer], pending: List[PendingAkkaPeer])
+
+class AkkaServerActor(system: ActorSystem) extends AkkaActor with ServerActorPrototype[AkkaPeers] {
+
+ import context.become
+
+ protected def reply(what: Any): Unit = sender ! what
+
+ protected def kickOff(peers: AkkaPeers, value: Int): Unit = {
+ val ping = context.actorOf(Props(new AkkaPingActor(peers.connected map (_.channel))))
+ ping ! SetParent(sender)
+ ping ! KickOff(value)
+ //println("[" + peers + "]: KickOff(" + value + ")")
+ }
+
+ protected def connectionEstablished(peers: AkkaPeers, x: Any): AkkaPeers = x match {
+ case PendingAkkaPeer(path, channel, client, token) => {
+ client ! Ok(token)
+ //println("connected to " + path)
+ AkkaPeers(AkkaPeer(path, channel) :: peers.connected, peers.pending filterNot (_.clientToken == token))
+ }
+ }
+
+ protected def newPending(peers: AkkaPeers, path: String, token: String) : AkkaPeers = {
+ val channel = system.actorFor(path)
+ channel ! Hello(token)
+ import akka.util.duration._
+ system.scheduler.scheduleOnce(5 seconds, self, AddPongTimeout(path, token))
+ //println("[" + peers + "]: sent 'Hello' to " + path)
+ AkkaPeers(peers.connected, PendingAkkaPeer(path, channel, sender, token) :: peers.pending)
+ }
+
+ protected override def handleAddPongTimeout(peers: AkkaPeers, path: String, token: String) = {
+ peers.pending find (x => x.path == path && x.clientToken == token) match {
+ case Some(PendingAkkaPeer(_, channel, client, _)) => {
+ client ! Error(path + " did not respond", token)
+ //println(path + " did not respond")
+ (true, AkkaPeers(peers.connected, peers.pending filterNot (x => x.path == path && x.clientToken == token)))
+ }
+ case None => (false, peers)
+ }
+ }
+
+ def bhvr(peers: AkkaPeers): Receive = {
+ case x => {
+ recvFun(peers)(x) match {
+ case (true, newPeers) => become(bhvr(newPeers))
+ case _ => Unit
+ }
+ }
+ }
+
+ def receive = bhvr(AkkaPeers(Nil, Nil))
+
+}
+
+case class TokenTimeout(token: String)
+case class RunAkkaClient(paths: List[String], numPings: Int)
+
+class AkkaClientActor(system: ActorSystem) extends AkkaActor {
+
+ import context.become
+
+ def collectDoneMessages(left: Int): Receive = {
+ case Done => {
+//println("Done")
+ if (left == 1) {
+ global.latch.countDown
+ context.stop(self)
+ } else {
+ become(collectDoneMessages(left - 1))
+ }
+ }
+ case _ => {
+ // ignore any other message
+ }
+ }
+
+ def collectOkMessages(pongs: List[AkkaActorRef], left: Int, receivedTokens: List[String], numPings: Int): Receive = {
+ case Ok(token) => {
+//println("Ok")
+ if (left == 1) {
+ //println("collected all Ok messages (wait for Done messages)")
+ pongs foreach (_ ! KickOff(numPings))
+ become(collectDoneMessages(pongs.length * (pongs.length - 1)))
+ }
+ else {
+ become(collectOkMessages(pongs, left - 1, token :: receivedTokens, numPings))
+ }
+ }
+ case TokenTimeout(token) => {
+ if (!receivedTokens.contains(token)) {
+ println("Error: " + token + " did not reply within 10 seconds")
+ global.latch.countDown
+ context.stop(self)
+ }
+ }
+ case Error(what, token) => {
+ println("Error [from " + token+ "]: " + what)
+ global.latch.countDown
+ context.stop(self)
+ }
+ }
+
+ def receive = {
+ case RunAkkaClient(paths, numPings) => {
+//println("RunAkkaClient(" + paths.toString + ", " + numPings + ")")
+ import akka.util.duration._
+ val pongs = paths map (x => {
+ val pong = system.actorFor(x)
+ paths foreach (y => if (x != y) {
+ val token = x + " -> " + y
+ pong ! AddPong(y, token)
+//println(x + " ! AddPong(" + y + ", " + token + ")")
+ system.scheduler.scheduleOnce(10 seconds, self, TokenTimeout(token))
+ })
+ pong
+ })
+ become(collectOkMessages(pongs, pongs.length * (pongs.length - 1), Nil, numPings))
+ }
+ }
+}
+
+object DistributedClientApp {
+
+ val NumPings = "num_pings=([0-9]+)".r
+ val SimpleUri = "([0-9a-zA-Z\\.]+):([0-9]+)".r
+
+ @tailrec def run(args: List[String], paths: List[String], numPings: Option[Int], finalizer: (List[String], Int) => Unit): Unit = args match {
+ case NumPings(num) :: tail => numPings match {
+ case Some(x) => throw new IllegalArgumentException("\"num_pings\" already defined, first value = " + x + ", second value = " + num)
+ case None => run(tail, paths, Some(num.toInt), finalizer)
+ }
+ case arg :: tail => run(tail, arg :: paths, numPings, finalizer)
+ case Nil => numPings match {
+ case Some(x) => {
+ if (paths.length < 2) throw new RuntimeException("at least two hosts required")
+ finalizer(paths, x)
+ }
+ case None => throw new RuntimeException("no \"num_pings\" found")
+ }
+ }
+
+ def main(args: Array[String]): Unit = {
+ try {
+ args(0) match {
+ case "remote_actors" => run(args.toList.drop(1), Nil, None, ((paths, x) => {
+ (new ClientActor(paths map (path => path match { case SimpleUri(host, port) => RemoteActorPath(path, host, port.toInt) }), x)).start
+ }))
+ case "akka" => run(args.toList.drop(1), Nil, None, ((paths, x) => {
+ val system = ActorSystem("benchmark", ConfigFactory.load.getConfig("benchmark"))
+ system.actorOf(Props(new AkkaClientActor(system))) ! RunAkkaClient(paths, x)
+ global.latch.await
+ system.shutdown
+ System.exit(0)
+ }))
+ }
+ }
+ catch {
+ case e => {
+ println("usage: DistributedClientApp (remote_actors|akka) {nodes...} num_pings={num}\nexample: DistributedClientApp remote_actors localhost:1234 localhost:2468 num_pings=1000\n")
+ throw e
+ }
+ }
+ }
+}
+
+object DistributedServerApp {
+
+ val IntStr = "([0-9]+)".r
+
+ def main(args: Array[String]): Unit = args match {
+ case Array("remote_actors", IntStr(istr)) => (new ServerActor(istr.toInt)).start
+ case Array("akka") => {
+ val system = ActorSystem("pongServer", ConfigFactory.load.getConfig("pongServer"))
+ val pong = system.actorOf(Props(new AkkaServerActor(system)), "pong")
+ Unit
+ }
+ case _ => println("usage: DistributedServerApp remote_actors PORT\n" +
+ " or: DistributedServerApp akka")
+ }
+}
diff --git a/benchmarks/FindLibcppa.cmake b/benchmarks/FindLibcppa.cmake
new file mode 100644
index 0000000000..c1f1d2236a
--- /dev/null
+++ b/benchmarks/FindLibcppa.cmake
@@ -0,0 +1,65 @@
+# - Try to find libcppa
+# Once done this will define
+#
+# CPPA_FOUND - system has libcppa
+# CPPA_INCLUDE - libcppa include dir
+# CPPA_LIBRARY - link againgst libcppa
+#
+
+if (CPPA_LIBRARY AND CPPA_INCLUDE)
+ set(CPPA_FOUND TRUE)
+else (CPPA_LIBRARY AND CPPA_INCLUDE)
+
+ find_path(CPPA_INCLUDE
+ NAMES
+ cppa/cppa.hpp
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ ${CPPA_INCLUDE_PATH}
+ ${CPPA_LIBRARY_PATH}
+ ${CMAKE_INCLUDE_PATH}
+ ${CMAKE_INSTALL_PREFIX}/include
+ )
+
+ if (CPPA_INCLUDE)
+ message (STATUS "Header files found ...")
+ else (CPPA_INCLUDE)
+ message (SEND_ERROR "Header files NOT found. Provide absolute path with -DCPPA_INCLUDE_PATH=.")
+ endif (CPPA_INCLUDE)
+
+ find_library(CPPA_LIBRARY
+ NAMES
+ libcppa
+ cppa
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ ${CPPA_INCLUDE_PATH}
+ ${CPPA_INCLUDE_PATH}/.libs
+ ${CPPA_LIBRARY_PATH}
+ ${CPPA_LIBRARY_PATH}/.libs
+ ${CMAKE_LIBRARY_PATH}
+ ${CMAKE_INSTALL_PREFIX}/lib
+ ${LIBRARY_OUTPUT_PATH}
+ )
+
+ if (CPPA_LIBRARY)
+ message (STATUS "Library found ...")
+ else (CPPA_LIBRARY)
+ message (SEND_ERROR "Library NOT found. Provide absolute path with -DCPPA_LIBRARY_PATH=.")
+ endif (CPPA_LIBRARY)
+
+ if (CPPA_INCLUDE AND CPPA_LIBRARY)
+ set(CPPA_FOUND TRUE)
+ set(CPPA_INCLUDE ${CPPA_INCLUDE})
+ set(CPPA_LIBRARY ${CPPA_LIBRARY})
+ else (CPPA_INCLUDE AND CPPA_LIBRARY)
+ message (FATAL_ERROR "CPPA LIBRARY AND/OR HEADER NOT FOUND!")
+ endif (CPPA_INCLUDE AND CPPA_LIBRARY)
+
+endif (CPPA_LIBRARY AND CPPA_INCLUDE)
diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am
deleted file mode 100644
index c1f35e99e5..0000000000
--- a/benchmarks/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-AUTOMAKE_OPTIONS = subdir-objects
-ACLOCAL_AMFLAGS = -I ../m4
-
-AM_CXXFLAGS = -I../ --std=c++0x -pedantic -Wall -Wextra
-
-noinst_PROGRAMS = actor_creation mailbox_performance mixed_case matching
-
-actor_creation_SOURCES = actor_creation.cpp
-mailbox_performance_SOURCES = mailbox_performance.cpp
-mixed_case_SOURCES = mixed_case.cpp
-matching_SOURCES = matching.cpp
-
-EXAMPLES_LIBS = -L../.libs/ -lcppa $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
-
-actor_creation_LDADD = $(EXAMPLES_LIBS)
-mailbox_performance_LDADD = $(EXAMPLES_LIBS)
-mixed_case_LDADD = $(EXAMPLES_LIBS)
-matching_LDADD = $(EXAMPLES_LIBS)
diff --git a/benchmarks/actor_creation.cpp b/benchmarks/actor_creation.cpp
index 002e07a000..e5f7ef6b23 100644
--- a/benchmarks/actor_creation.cpp
+++ b/benchmarks/actor_creation.cpp
@@ -35,7 +35,7 @@
#include "utility.hpp"
#include "cppa/cppa.hpp"
-#include "cppa/fsm_actor.hpp"
+#include "cppa/sb_actor.hpp"
using std::cout;
using std::cerr;
@@ -44,34 +44,25 @@ using std::uint32_t;
using namespace cppa;
-struct testee : fsm_actor
-{
+struct testee : sb_actor {
actor_ptr parent;
behavior init_state;
- testee(const actor_ptr& pptr) : parent(pptr)
- {
- init_state =
- (
- on(atom("spread"), 0) >> [=]()
- {
+ testee(const actor_ptr& pptr) : parent(pptr) {
+ init_state = (
+ on(atom("spread"), 0) >> [=]() {
send(parent, atom("result"), (uint32_t) 1);
- become_void();
+ quit();
},
- on() >> [=](int x)
- {
+ on() >> [=](int x) {
any_tuple msg = make_cow_tuple(atom("spread"), x - 1);
- spawn(new testee(this)) << msg;
- spawn(new testee(this)) << msg;
- become
- (
- on() >> [=](uint32_t r1)
- {
- become
- (
- on() >> [=](uint32_t r2)
- {
+ spawn(this) << msg;
+ spawn(this) << msg;
+ become (
+ on() >> [=](uint32_t r1) {
+ become (
+ on() >> [=](uint32_t r2) {
send(parent, atom("result"), r1 + r2);
- become_void();
+ quit();
}
);
}
@@ -81,27 +72,19 @@ struct testee : fsm_actor
}
};
-void stacked_testee(actor_ptr parent)
-{
- receive
- (
- on(atom("spread"), 0) >> [&]()
- {
+void stacked_testee(actor_ptr parent) {
+ receive (
+ on(atom("spread"), 0) >> [&]() {
send(parent, atom("result"), (uint32_t) 1);
},
- on() >> [&](int x)
- {
+ on() >> [&](int x) {
any_tuple msg = make_cow_tuple(atom("spread"), x-1);
spawn(stacked_testee, self) << msg;
spawn(stacked_testee, self) << msg;
- receive
- (
- on() >> [&](uint32_t v1)
- {
- receive
- (
- on() >> [&](uint32_t v2)
- {
+ receive (
+ on() >> [&](uint32_t v1) {
+ receive (
+ on() >> [&](uint32_t v2) {
send(parent, atom("result"), v1 + v2);
}
);
@@ -111,45 +94,38 @@ void stacked_testee(actor_ptr parent)
);
}
-void usage()
-{
+void usage() {
cout << "usage: actor_creation (stacked|event-based) POW" << endl
<< " creates 2^POW actors" << endl
<< endl;
}
-int main(int argc, char** argv)
-{
- if (argc == 3)
- {
+int main(int argc, char** argv) {
+ if (argc == 3) {
int num = rd(argv[2]);
- if (strcmp(argv[1], "stacked") == 0)
- {
+ if (strcmp(argv[1], "stacked") == 0) {
send(spawn(stacked_testee, self), atom("spread"), num);
}
- else if (strcmp(argv[1], "event-based") == 0)
- {
- send(spawn(new testee(self)), atom("spread"), num);
+ else if (strcmp(argv[1], "event-based") == 0) {
+ send(spawn(self), atom("spread"), num);
}
- else
- {
+ else {
usage();
return 1;
}
- receive
- (
- on() >> [=](uint32_t value)
- {
+ receive (
+ on() >> [=](uint32_t value) {
//cout << "value = " << value << endl
// << "expected => 2^" << num << " = "
// << (1 << num) << endl;
- assert(value == (((uint32_t) 1) << num));
+ if (value != (((uint32_t) 1) << num)) {
+ cerr << "ERROR: received wrong result!\n";
+ }
}
);
await_all_others_done();
}
- else
- {
+ else {
usage();
return 1;
}
diff --git a/benchmarks/application.conf b/benchmarks/application.conf
new file mode 100644
index 0000000000..d1c6062969
--- /dev/null
+++ b/benchmarks/application.conf
@@ -0,0 +1,36 @@
+benchmark {
+ akka {
+ loglevel = ERROR
+ actor.provider = "akka.remote.RemoteActorRefProvider"
+ remote {
+ transport = "akka.remote.netty.NettyRemoteTransport"
+ untrusted-mode = on
+# remote-daemon-ack-timeout = 300s
+# netty {
+# connection-timeout = 1800s
+# }
+ }
+ }
+}
+pongServer {
+ akka {
+ loglevel = ERROR
+ actor {
+ provider = "akka.remote.RemoteActorRefProvider"
+ }
+ remote {
+ transport = "akka.remote.netty.NettyRemoteTransport"
+ untrusted-mode = on
+# remote-daemon-ack-timeout = 300s
+ netty {
+# backoff-timeout = 0ms
+ connection-timeout = 1800s
+# read-timeout = 1800s
+# write-timeout = 10s
+ all-timeout = 1800s
+ #hostname = "mobi10"
+ port = 2244
+ }
+ }
+ }
+}
diff --git a/benchmarks/distributed.cpp b/benchmarks/distributed.cpp
new file mode 100644
index 0000000000..5f4954ffb0
--- /dev/null
+++ b/benchmarks/distributed.cpp
@@ -0,0 +1,407 @@
+/******************************************************************************\
+ * ___ __ *
+ * /\_ \ __/\ \ *
+ * \//\ \ /\_\ \ \____ ___ _____ _____ __ *
+ * \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
+ * \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
+ * /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
+ * \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
+ * \ \_\ \ \_\ *
+ * \/_/ \/_/ *
+ * *
+ * Copyright (C) 2011, 2012 *
+ * Dominik Charousset *
+ * *
+ * This file is part of libcppa. *
+ * libcppa is free software: you can redistribute it and/or modify it under *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License *
+ * or (at your option) any later version. *
+ * *
+ * libcppa is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
+ * See the GNU Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public License *
+ * along with libcppa. If not, see . *
+\******************************************************************************/
+
+
+#include
+#include
+#include
+
+#include
+#include
+
+#include "utility.hpp"
+#include "cppa/cppa.hpp"
+#include "cppa/match.hpp"
+#include "cppa/actor_proxy.hpp"
+
+using std::cout;
+using std::endl;
+using std::string;
+using std::uint16_t;
+using std::uint32_t;
+
+using namespace cppa;
+using namespace cppa::placeholders;
+
+#define PRINT_MESSAGE() { \
+std::ostringstream oss; \
+oss << to_string(self->parent_process()) << ": " << __PRETTY_FUNCTION__ << " ->" \
+ << to_string(self->last_dequeued()) \
+ << "\n"; \
+cout << oss.str(); \
+} ((void) 0)
+
+option c_2i(const char* cstr) {
+ char* endptr = nullptr;
+ int result = static_cast(strtol(cstr, &endptr, 10));
+ if (endptr == nullptr || *endptr != '\0') {
+ return {};
+ }
+ return result;
+}
+
+inline option _2i(const std::string& str) {
+ return c_2i(str.c_str());
+}
+
+void usage() {
+ cout << "Running in server mode:" << endl
+ << " mode=server " << endl
+ << " --port=NUM publishes an actor at port NUM" << endl
+ << " -p NUM alias for --port=NUM" << endl
+ << endl
+ << endl
+ << "Running the benchmark:" << endl
+ << " mode=benchmark run the benchmark, connect to any number" << endl
+ << " of given servers, use HOST:PORT syntax" << endl
+ << " num_pings=NUM run benchmark with NUM messages per node" << endl
+ << endl
+ << " example: mode=benchmark 192.168.9.1:1234 "
+ "192.168.9.2:1234 "
+ "--num_pings=100" << endl
+ << endl
+ << endl
+ << "Shutdown servers:" << endl
+ << " mode=shutdown shuts down any number of given servers" << endl
+ << endl
+ << endl
+ << "Miscellaneous:" << endl
+ << " -h, --help print this text and exit" << endl
+ << endl;
+ exit(0);
+}
+
+template
+class actor_template {
+
+ MatchExpr m_expr;
+
+ public:
+
+ actor_template(MatchExpr me) : m_expr(std::move(me)) { }
+
+ actor_ptr spawn() const {
+ struct impl : sb_actor {
+ behavior init_state;
+ impl(const MatchExpr& mx) : init_state(mx.as_partial_function()) {
+ }
+ };
+ return cppa::spawn(new impl{m_expr});
+ }
+
+};
+
+template
+auto actor_prototype(const Args&... args) -> actor_template {
+ return {mexpr_concat(args...)};
+}
+
+struct ping_actor : sb_actor {
+
+ behavior init_state;
+ actor_ptr parent;
+
+ ping_actor(actor_ptr parent_ptr) : parent(std::move(parent_ptr)) {
+ init_state = (
+ on(atom("kickoff"), arg_match) >> [=](actor_ptr pong, uint32_t value) {
+ send(pong, atom("ping"), value);
+ become (
+ on().when(_x2 == uint32_t(0)) >> [=]() {
+ send(parent, atom("done"));
+ quit();
+ },
+ on(atom("pong"), arg_match) >> [=](uint32_t value) {
+ reply(atom("ping"), value - 1);
+ },
+ others() >> [=]() {
+ cout << "ping_actor: unexpected: "
+ << to_string(last_dequeued())
+ << endl;
+ }
+ );
+ },
+ others() >> [=]() {
+ cout << "ping_actor: unexpected: "
+ << to_string(last_dequeued())
+ << endl;
+ }
+ );
+ }
+
+};
+
+struct server_actor : sb_actor {
+
+ typedef std::map, actor_ptr> pong_map;
+
+ behavior init_state;
+ pong_map m_pongs;
+
+ server_actor() {
+ trap_exit(true);
+ init_state = (
+ on(atom("ping"), arg_match) >> [=](uint32_t value) {
+ reply(atom("pong"), value);
+ },
+ on(atom("add_pong"), arg_match) >> [=](const string& host, uint16_t port) {
+ auto key = std::make_pair(host, port);
+ auto i = m_pongs.find(key);
+ if (i == m_pongs.end()) {
+ try {
+ auto p = remote_actor(host.c_str(), port);
+ link_to(p);
+ m_pongs.insert(std::make_pair(key, p));
+ reply(atom("ok"));
+ }
+ catch (std::exception& e) {
+ reply(atom("error"), e.what());
+ }
+ }
+ else {
+ reply(atom("ok"));
+ }
+ },
+ on(atom("kickoff"), arg_match) >> [=](uint32_t num_pings) {
+ for (auto& kvp : m_pongs) {
+ auto ping = spawn(last_sender());
+ send(ping, atom("kickoff"), kvp.second, num_pings);
+ }
+ },
+ on(atom("purge")) >> [=]() {
+ m_pongs.clear();
+ },
+ on() >> [=]() {
+ actor_ptr who = last_sender();
+ auto i = std::find_if(m_pongs.begin(), m_pongs.end(),
+ [&](const pong_map::value_type& kvp) {
+ return kvp.second == who;
+ });
+ if (i != m_pongs.end()) m_pongs.erase(i);
+ },
+ on(atom("shutdown")) >> [=]() {
+ m_pongs.clear();
+ quit();
+ },
+ others() >> [=]() {
+ cout << "unexpected: " << to_string(last_dequeued()) << endl;
+ }
+
+ );
+ }
+
+};
+
+template
+void usage(Arg0&& arg0) {
+ cout << std::forward(arg0) << endl << endl;
+ usage();
+}
+
+template
+void usage(Arg0&& arg0, Arg1&& arg1, Args&&... args) {
+ cout << std::forward(arg0);
+ usage(std::forward(arg1), std::forward(args)...);
+}
+
+template
+void server_mode(Iterator first, Iterator last) {
+ string port_prefix = "--port=";
+ // extracts port from a key-value pair
+ auto kvp_port = [&](const string& str) -> option {
+ if (std::equal(port_prefix.begin(), port_prefix.end(), str.begin())) {
+ return c_2i(str.c_str() + port_prefix.size());
+ }
+ return {};
+ };
+ match(std::vector{first, last}) ( (on(kvp_port) || on("-p", _2i)) >> [](int port) {
+ if (port > 1024 && port < 65536) {
+ publish(spawn(), port);
+ }
+ else {
+ usage("illegal port: ", port);
+ }
+ },
+ others() >> [=]() {
+ if (first != last) usage("illegal argument: ", *first);
+ else usage();
+ }
+ );
+ await_all_others_done();
+}
+
+template
+void client_mode(Iterator first, Iterator last) {
+ if (first == last) usage("no server, no fun");
+ std::uint32_t init_value = 0;
+ std::vector > remotes;
+ string pings_prefix = "--num_pings=";
+ auto num_msgs = [&](const string& str) -> option {
+ if (std::equal(pings_prefix.begin(), pings_prefix.end(), str.begin())) {
+ return c_2i(str.c_str() + pings_prefix.size());
+ }
+ return {};
+ };
+ match_each(first, last, std::bind(split, std::placeholders::_1, ':')) (
+ on(val, _2i) >> [&](string& host, int port) {
+ if (port <= 1024 || port >= 65536) {
+ throw std::invalid_argument("illegal port: " + std::to_string(port));
+ }
+ remotes.emplace_back(std::move(host), static_cast(port));
+ },
+ on(num_msgs) >> [&](int num) {
+ if (num > 0) init_value = static_cast(num);
+ }
+ );
+ if (init_value == 0) {
+ cout << "no non-zero, non-negative init value given" << endl;
+ exit(1);
+ }
+ if (remotes.size() < 2) {
+ cout << "less than two nodes given" << endl;
+ exit(1);
+ }
+ std::vector remote_actors;
+ for (auto& r : remotes) {
+ remote_actors.push_back(remote_actor(r.first.c_str(), r.second));
+ }
+ // setup phase
+ //cout << "tell server nodes to connect to each other" << endl;
+ for (size_t i = 0; i < remotes.size(); ++i) {
+ for (size_t j = 0; j < remotes.size(); ++j) {
+ if (i != j) {
+ auto& r = remotes[j];
+ send(remote_actors[i], atom("add_pong"), r.first, r.second);
+ }
+ }
+ }
+ { // collect {ok} messages
+ size_t i = 0;
+ size_t end = remote_actors.size() * (remote_actors.size() - 1);
+ receive_for(i, end) (
+ on(atom("ok")) >> []() {
+ },
+ on(atom("error"), arg_match) >> [&](const string& str) {
+ cout << "error: " << str << endl;
+ for (auto& x : remote_actors) {
+ send(x, atom("purge"));
+ }
+ throw std::logic_error("");
+ },
+ others() >> []() {
+ cout << "expected {ok|error}, received: "
+ << to_string(self->last_dequeued())
+ << endl;
+ throw std::logic_error("");
+ },
+ after(std::chrono::seconds(10)) >> [&]() {
+ cout << "remote didn't answer within 10sec." << endl;
+ for (auto& x : remote_actors) {
+ send(x, atom("purge"));
+ }
+ throw std::logic_error("");
+ }
+ );
+ }
+ // kickoff
+ //cout << "setup done" << endl;
+ //cout << "kickoff, init value = " << init_value << endl;
+ for (auto& r : remote_actors) {
+ send(r, atom("kickoff"), init_value);
+ }
+ { // collect {done} messages
+ size_t i = 0;
+ size_t end = remote_actors.size() * (remote_actors.size() - 1);
+ receive_for(i, end) (
+ on(atom("done")) >> []() {
+ //cout << "...done..." << endl;
+ },
+ others() >> []() {
+ cout << "unexpected: " << to_string(self->last_dequeued()) << endl;
+ throw std::logic_error("");
+ }
+ );
+ }
+ await_all_others_done();
+}
+
+template
+void shutdown_mode(Iterator first, Iterator last) {
+ std::vector > remotes;
+ match_each(first, last, std::bind(split, std::placeholders::_1, ':')) (
+ on(val, _2i) >> [&](string& host, int port) {
+ if (port <= 1024 || port >= 65536) {
+ throw std::invalid_argument("illegal port: " + std::to_string(port));
+ }
+ remotes.emplace_back(std::move(host), static_cast(port));
+ }
+ );
+ for (auto& r : remotes) {
+ try {
+ actor_ptr x = remote_actor(r.first.c_str(), r.second);
+ self->monitor(x);
+ send(x, atom("shutdown"));
+ receive (
+ on(atom("DOWN"), val) >> []() {
+ // ok, done
+ },
+ after(std::chrono::seconds(10)) >> [&]() {
+ cout << r.first << ":" << r.second << " didn't shut down "
+ << "within 10s"
+ << endl;
+ }
+ );
+ }
+ catch (...) {
+ }
+ }
+}
+
+int main(int argc, char** argv) {
+ if (argc < 2) usage();
+ auto first = argv + 1;
+ auto last = argv + argc;
+ match(*first) (
+ on().when(_x1.in({"-h", "--help"})) >> []() {
+ usage();
+ },
+ on("mode=server") >> [=]() {
+ server_mode(first + 1, last);
+ },
+ on("mode=benchmark") >> [=]() {
+ client_mode(first + 1, last);
+ await_all_others_done();
+ },
+ on("mode=shutdown") >> [=]() {
+ shutdown_mode(first + 1, last);
+ },
+ others() >> [=]() {
+ usage("unknown argument: ", *first);
+ }
+ );
+}
diff --git a/benchmarks/distributed.erl b/benchmarks/distributed.erl
new file mode 100644
index 0000000000..8bb4da68db
--- /dev/null
+++ b/benchmarks/distributed.erl
@@ -0,0 +1,107 @@
+-module(distributed).
+-export([start/1, ping_loop/2]).
+
+ping_loop(Parent, Pong) ->
+ receive
+ {pong, 0} -> Parent ! done;
+ {pong, X} ->
+ Pong ! {ping, self(), X - 1},
+ ping_loop(Parent, Pong);
+ {kickoff, X} ->
+ Pong ! {ping, self(), X},
+ ping_loop(Parent, Pong);
+ _ -> ping_loop(Parent, Pong)
+ end.
+
+server_loop(Pongs) ->
+ receive
+ {ping, Pid, X} ->
+ Pid ! {pong, X},
+ server_loop(Pongs);
+ {add_pong, Pid, Node} ->
+ case lists:any(fun({N, _}) -> N == Node end, Pongs) of
+ true ->
+ Pid ! {ok, cached},
+ server_loop(Pongs);
+ false ->
+ case rpc:call(Node, erlang, whereis, [pong]) of
+ {badrpc, Reason} ->
+ Pid ! {error, Reason},
+ server_loop(Pongs);
+ undefined ->
+ Pid ! {error, 'pong is undefined'},
+ server_loop(Pongs);
+ Pong ->
+ Pid ! {ok, added},
+ server_loop(Pongs ++ [{Node, Pong}])
+ end
+ end;
+ {purge} -> server_loop([]);
+ {get_pongs, Pid} ->
+ Pid ! Pongs,
+ server_loop(Pongs);
+ {kickoff, Pid, NumPings} ->
+ lists:foreach(fun({_, P}) -> spawn(distributed, ping_loop, [Pid, P]) ! {kickoff, NumPings} end, Pongs),
+ server_loop(Pongs);
+ _ -> server_loop(Pongs)
+ end.
+
+server_mode() ->
+ register(pong, self()),
+ server_loop([]).
+
+add_pong_fun(_, _, []) -> true;
+add_pong_fun(Pong, Node, [Node|T]) -> add_pong_fun(Pong, Node, T);
+add_pong_fun(Pong, Node, [H|T]) ->
+ Pong ! {add_pong, self(), H},
+ receive
+ {ok, _} -> add_pong_fun(Pong, Node, T);
+ {error, Reason} -> error(Reason)
+ after 10000 -> error(timeout)
+ end.
+
+client_mode_receive_done_msgs(0) -> true;
+client_mode_receive_done_msgs(Left) ->
+ receive done -> client_mode_receive_done_msgs(Left - 1) end.
+
+
+% receive a {done} message for each node
+client_mode([], [], [], _) -> error("no node, no fun");
+client_mode([], [], Nodes, _) ->
+ client_mode_receive_done_msgs(length(Nodes) * (length(Nodes) - 1));
+
+% send kickoff messages
+client_mode([Pong|Pongs], [], Nodes, NumPings) ->
+ Pong ! {kickoff, self(), NumPings},
+ client_mode(Pongs, [], Nodes, NumPings);
+
+client_mode(Pongs, [H|T], Nodes, NumPings) ->
+ case rpc:call(H, erlang, whereis, [pong]) of
+ {badrpc, Reason} ->
+ io:format("cannot connect to ~s~n", [atom_to_list(H)]),
+ error(Reason);
+ undefined ->
+ io:format("no 'pong' defined on node ~s~n", [atom_to_list(H)]);
+ P ->
+ add_pong_fun(P, H, Nodes),
+ client_mode(Pongs ++ [P], T, Nodes, NumPings)
+ end.
+
+run(_, undefined, []) -> error("NumPings is undefined");
+run(Hosts, _, []) when length(Hosts) < 2 -> error("less than two nodes specified");
+run(Hosts, NumPings, []) -> client_mode([], Hosts, Hosts, NumPings);
+run(Hosts, NumPings, [H|T]) ->
+ Arg = atom_to_list(H),
+ case lists:prefix("num_pings=", Arg) of
+ true when NumPings /= undefined -> error("NumPings already set");
+ true -> run(Hosts, list_to_integer(lists:sublist(Arg, 11, length(Arg))), T);
+ false -> run(Hosts ++ [H], NumPings, T)
+ end.
+
+start(X) ->
+ case X of
+ ['mode=server'|[]] -> server_mode();
+ ['mode=server'|_] -> io:format("too much arguments~n", []);
+ ['mode=benchmark'|T] -> run([], undefined, T);
+ _ -> io:format("invalid arguments~n", [])
+ end.
diff --git a/benchmarks/erlang_test.sh b/benchmarks/erlang_test.sh
index 229d0e6f19..17599c1d47 100755
--- a/benchmarks/erlang_test.sh
+++ b/benchmarks/erlang_test.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-echo "erl -noshell -noinput +P 20000000 -s $@ -s init stop" | ./exec.sh
+echo "erl -noshell -noinput +P 20000000 -setcookie abc123 -sname benchmark -s $@ -s init stop" | ./exec.sh
diff --git a/benchmarks/mailbox_performance.cpp b/benchmarks/mailbox_performance.cpp
index 5705f076db..8592fa5825 100644
--- a/benchmarks/mailbox_performance.cpp
+++ b/benchmarks/mailbox_performance.cpp
@@ -28,6 +28,7 @@
\******************************************************************************/
+#include
#include
#include
#include
@@ -35,8 +36,7 @@
#include "utility.hpp"
#include "cppa/cppa.hpp"
-#include "cppa/fsm_actor.hpp"
-#include "cppa/detail/thread.hpp"
+#include "cppa/sb_actor.hpp"
using std::cout;
using std::cerr;
@@ -45,83 +45,64 @@ using std::int64_t;
using namespace cppa;
-struct fsm_receiver : fsm_actor
-{
+struct fsm_receiver : sb_actor {
int64_t m_value;
behavior init_state;
- fsm_receiver(int64_t max) : m_value(0)
- {
- init_state =
- (
- on(atom("msg")) >> [=]()
- {
+ fsm_receiver(int64_t max) : m_value(0) {
+ init_state = (
+ on(atom("msg")) >> [=]() {
++m_value;
- if (m_value == max)
- {
- become_void();
+ if (m_value == max) {
+ quit();
}
}
);
}
};
-void receiver(int64_t max)
-{
+void receiver(int64_t max) {
int64_t value;
- receive_while(gref(value) < max)
- //receive_while([&]() { return value < max; })
- (
- on(atom("msg")) >> [&]()
- {
+ receive_while(gref(value) < max) (
+ on(atom("msg")) >> [&]() {
++value;
}
);
}
-void sender(actor_ptr whom, int64_t count)
-{
+void sender(actor_ptr whom, int64_t count) {
any_tuple msg = make_cow_tuple(atom("msg"));
- for (int64_t i = 0; i < count; ++i)
- {
+ for (int64_t i = 0; i < count; ++i) {
whom->enqueue(nullptr, msg);
}
}
-void usage()
-{
+void usage() {
cout << "usage: mailbox_performance "
"(stacked|event-based) (sending threads) (msg per thread)" << endl
<< endl;
}
-int main(int argc, char** argv)
-{
- if (argc == 4)
- {
+int main(int argc, char** argv) {
+ if (argc == 4) {
int64_t num_sender = rd(argv[2]);
int64_t num_msgs = rd(argv[3]);
actor_ptr testee;
- if (strcmp(argv[1], "stacked") == 0)
- {
+ if (strcmp(argv[1], "stacked") == 0) {
testee = spawn(receiver, num_sender * num_msgs);
}
- else if (strcmp(argv[1], "event-based") == 0)
- {
- testee = spawn(new fsm_receiver(num_sender * num_msgs));
+ else if (strcmp(argv[1], "event-based") == 0) {
+ testee = spawn(num_sender * num_msgs);
}
- else
- {
+ else {
usage();
return 1;
}
- for (int64_t i = 0; i < num_sender; ++i)
- {
- detail::thread(sender, testee, num_msgs).detach();
+ for (int64_t i = 0; i < num_sender; ++i) {
+ std::thread(sender, testee, num_msgs).detach();
}
await_all_others_done();
}
- else
- {
+ else {
usage();
return 1;
}
diff --git a/benchmarks/matching.cpp b/benchmarks/matching.cpp
index dc59dcaaaf..0d7936c32b 100644
--- a/benchmarks/matching.cpp
+++ b/benchmarks/matching.cpp
@@ -53,12 +53,10 @@ using std::int64_t;
using namespace cppa;
template
-T rd(char const* cstr)
-{
+T rd(const char* cstr) {
char* endptr = nullptr;
T result = static_cast(strtol(cstr, &endptr, 10));
- if (endptr == nullptr || *endptr != '\0')
- {
+ if (endptr == nullptr || *endptr != '\0') {
std::string errstr;
errstr += "\"";
errstr += cstr;
@@ -68,29 +66,71 @@ T rd(char const* cstr)
return result;
}
-int main(int argc, char** argv)
-{
+void usage() {
+ cerr << "usage: matching (cow_tuple|object_array) {NUM_LOOPS}" << endl;
+ exit(1);
+}
+
+int main(int argc, char** argv) {
announce>();
- if (argc != 2)
- {
- cerr << "usage: matching {NUM_LOOPS}" << endl;
- return 1;
+ if (argc != 3) usage();
+ auto num_loops = rd(argv[2]);
+ any_tuple m1;
+ any_tuple m2;
+ any_tuple m3;
+ any_tuple m4;
+ any_tuple m5;
+ any_tuple m6;
+
+ if (strcmp(argv[1], "cow_tuple") == 0) {
+ m1 = make_cow_tuple(atom("msg1"), 0);
+ m2 = make_cow_tuple(atom("msg2"), 0.0);
+ m3 = make_cow_tuple(atom("msg3"), list{0});
+ m4 = make_cow_tuple(atom("msg4"), 0, "0");
+ m5 = make_cow_tuple(atom("msg5"), 0, 0, 0);
+ m6 = make_cow_tuple(atom("msg6"), 0, 0.0, "0");
+ }
+ else if (strcmp(argv[1], "object_array") == 0) {
+ auto m1o = new detail::object_array;
+ m1o->push_back(object::from(atom("msg1")));
+ m1o->push_back(object::from(0));
+ m1 = any_tuple{m1o};
+ auto m2o = new detail::object_array;
+ m2o->push_back(object::from(atom("msg2")));
+ m2o->push_back(object::from(0.0));
+ m2 = any_tuple{m2o};
+ auto m3o = new detail::object_array;
+ m3o->push_back(object::from(atom("msg3")));
+ m3o->push_back(object::from(list{0}));
+ m3 = any_tuple{m3o};
+ auto m4o = new detail::object_array;
+ m4o->push_back(object::from(atom("msg4")));
+ m4o->push_back(object::from(0));
+ m4o->push_back(object::from(std::string("0")));
+ m4 = any_tuple{m4o};
+ auto m5o = new detail::object_array;
+ m5o->push_back(object::from(atom("msg5")));
+ m5o->push_back(object::from(0));
+ m5o->push_back(object::from(0));
+ m5o->push_back(object::from(0));
+ m5 = any_tuple{m5o};
+ auto m6o = new detail::object_array;
+ m6o->push_back(object::from(atom("msg6")));
+ m6o->push_back(object::from(0));
+ m6o->push_back(object::from(0.0));
+ m6o->push_back(object::from(std::string("0")));
+ m6 = any_tuple{m6o};
+ }
+ else {
+ usage();
}
- auto num_loops = rd(argv[1]);
- any_tuple m1 = make_cow_tuple(atom("msg1"), 0);
- any_tuple m2 = make_cow_tuple(atom("msg2"), 0.0);
- any_tuple m3 = cppa::make_cow_tuple(atom("msg3"), list{0});
- any_tuple m4 = make_cow_tuple(atom("msg4"), 0, "0");
- any_tuple m5 = make_cow_tuple(atom("msg5"), 0, 0, 0);
- any_tuple m6 = make_cow_tuple(atom("msg6"), 0, 0.0, "0");
int64_t m1matched = 0;
int64_t m2matched = 0;
int64_t m3matched = 0;
int64_t m4matched = 0;
int64_t m5matched = 0;
int64_t m6matched = 0;
- auto part_fun =
- (
+ auto part_fun = (
on() >> [&]() { ++m1matched; },
on() >> [&]() { ++m2matched; },
on >() >> [&]() { ++m3matched; },
@@ -98,8 +138,7 @@ int main(int argc, char** argv)
on() >> [&]() { ++m5matched; },
on() >> [&]() { ++m6matched; }
);
- for (int64_t i = 0; i < num_loops; ++i)
- {
+ for (int64_t i = 0; i < num_loops; ++i) {
part_fun(m1);
part_fun(m2);
part_fun(m3);
@@ -107,4 +146,10 @@ int main(int argc, char** argv)
part_fun(m5);
part_fun(m6);
}
+ assert(m1matched == num_loops);
+ assert(m2matched == num_loops);
+ assert(m3matched == num_loops);
+ assert(m4matched == num_loops);
+ assert(m5matched == num_loops);
+ assert(m6matched == num_loops);
}
diff --git a/benchmarks/mixed_case.cpp b/benchmarks/mixed_case.cpp
index 9cbaba9aa1..79ba40e924 100644
--- a/benchmarks/mixed_case.cpp
+++ b/benchmarks/mixed_case.cpp
@@ -35,79 +35,10 @@
#include "utility.hpp"
-//#include "boost/threadpool.hpp"
-
#include "cppa/cppa.hpp"
-#include "cppa/fsm_actor.hpp"
-#include "cppa/detail/mock_scheduler.hpp"
-#include "cppa/detail/yielding_actor.hpp"
-
-/*
-namespace cppa { namespace detail {
-
-struct pool_job
-{
- abstract_event_based_actor* ptr;
- pool_job(abstract_event_based_actor* mptr) : ptr(mptr) { }
- void operator()()
- {
- struct handler : abstract_scheduled_actor::resume_callback
- {
- abstract_event_based_actor* job;
- handler(abstract_event_based_actor* mjob) : job(mjob) { }
- void exec_done()
- {
- if (!job->deref()) delete job;
- dec_actor_count();
- }
- };
- handler h{ptr};
- ptr->resume(nullptr, &h);
- }
-};
-
-class boost_threadpool_scheduler : public scheduler
-{
-
- boost::threadpool::thread_pool m_pool;
- //boost::threadpool::pool m_pool;
-
- public:
-
- void start()
- {
- m_pool.size_controller().resize(std::max(num_cores(), 4));
- }
-
- void stop()
- {
- m_pool.wait();
- }
- void enqueue(abstract_scheduled_actor* what)
- {
- auto job = static_cast(what);
- boost::threadpool::schedule(m_pool, pool_job{job});
- }
-
- actor_ptr spawn(abstract_event_based_actor* what)
- {
- what->attach_to_scheduler(this);
- inc_actor_count();
- CPPA_MEMORY_BARRIER();
- intrusive_ptr ctx(what);
- ctx->ref();
- return std::move(ctx);
- }
-
- actor_ptr spawn(scheduled_actor* bhvr, scheduling_hint)
- {
- return mock_scheduler::spawn(bhvr);
- }
-
-};
-
-} } // namespace cppa::detail
-*/
+#include "cppa/match.hpp"
+#include "cppa/sb_actor.hpp"
+#include "cppa/context_switching_actor.hpp"
using std::cout;
using std::cerr;
@@ -123,93 +54,75 @@ constexpr uint64_t s_task_n = uint64_t(86028157)*329545133;
constexpr uint64_t s_factor1 = 86028157;
constexpr uint64_t s_factor2 = 329545133;
-void check_factors(const factors& vec)
-{
+void check_factors(const factors& vec) {
assert(vec.size() == 2);
assert(vec[0] == s_factor1);
assert(vec[1] == s_factor2);
+# ifdef NDEBUG
+ static_cast(vec);
+# endif
}
-struct fsm_worker : fsm_actor
-{
+struct fsm_worker : sb_actor {
actor_ptr mc;
behavior init_state;
- fsm_worker(const actor_ptr& msgcollector) : mc(msgcollector)
- {
- init_state =
- (
- on() >> [=](uint64_t what)
- {
+ fsm_worker(const actor_ptr& msgcollector) : mc(msgcollector) {
+ init_state = (
+ on() >> [=](uint64_t what) {
send(mc, atom("result"), factorize(what));
},
- on(atom("done")) >> [=]()
- {
- become_void();
+ on(atom("done")) >> [=]() {
+ quit();
}
);
}
};
-struct fsm_chain_link : fsm_actor
-{
+struct fsm_chain_link : sb_actor {
actor_ptr next;
behavior init_state;
- fsm_chain_link(const actor_ptr& n) : next(n)
- {
- init_state =
- (
- on() >> [=](int v)
- {
- next->enqueue(nullptr, std::move(self->last_dequeued()));
- if (v == 0) become_void();
+ fsm_chain_link(const actor_ptr& n) : next(n) {
+ init_state = (
+ on() >> [=](int v) {
+ next << std::move(last_dequeued());
+ if (v == 0) quit();
}
);
}
};
-struct fsm_chain_master : fsm_actor
-{
+struct fsm_chain_master : sb_actor {
int iteration;
actor_ptr mc;
actor_ptr next;
actor_ptr worker;
behavior init_state;
- void new_ring(int ring_size, int initial_token_value)
- {
+ void new_ring(int ring_size, int initial_token_value) {
send(worker, atom("calc"), s_task_n);
next = self;
- for (int i = 1; i < ring_size; ++i)
- {
- next = spawn(new fsm_chain_link(next));
+ for (int i = 1; i < ring_size; ++i) {
+ next = spawn(next);
}
send(next, atom("token"), initial_token_value);
}
- fsm_chain_master(actor_ptr msgcollector) : iteration(0), mc(msgcollector)
- {
- init_state =
- (
- on() >> [=](int rs, int itv, int n)
- {
- worker = spawn(new fsm_worker(msgcollector));
+ fsm_chain_master(actor_ptr msgcollector) : iteration(0), mc(msgcollector) {
+ init_state = (
+ on(atom("init"), arg_match) >> [=](int rs, int itv, int n) {
+ worker = spawn(msgcollector);
iteration = 0;
new_ring(rs, itv);
- become
- (
- on(atom("token"), 0) >> [=]()
- {
- if (++iteration < n)
- {
+ become (
+ on(atom("token"), 0) >> [=]() {
+ if (++iteration < n) {
new_ring(rs, itv);
}
- else
- {
+ else {
send(worker, atom("done"));
send(mc, atom("masterdone"));
- become_void();
+ quit();
}
},
- on() >> [=](int v)
- {
+ on() >> [=](int v) {
send(next, atom("token"), v - 1);
}
);
@@ -218,93 +131,71 @@ struct fsm_chain_master : fsm_actor
}
};
-struct fsm_supervisor : fsm_actor
-{
+struct fsm_supervisor : sb_actor {
int left;
behavior init_state;
- fsm_supervisor(int num_msgs) : left(num_msgs)
- {
- init_state =
- (
- on(atom("masterdone")) >> [=]()
- {
- if (--left == 0) become_void();
+ fsm_supervisor(int num_msgs) : left(num_msgs) {
+ init_state = (
+ on(atom("masterdone")) >> [=]() {
+ if (--left == 0) quit();
},
- on() >> [=](const factors& vec)
- {
+ on() >> [=](const factors& vec) {
check_factors(vec);
- if (--left == 0) become_void();
+ if (--left == 0) quit();
}
);
}
};
-void chain_link(actor_ptr next)
-{
+void chain_link(actor_ptr next) {
bool done = false;
- do_receive
- (
- on() >> [&](int v)
- {
- next << self->last_dequeued();
- if (v == 0)
- {
+ do_receive (
+ on() >> [&](int v) {
+ if (v == 0) {
done = true;
}
+ next << std::move(self->last_dequeued());
}
)
.until([&]() { return done == true; });
}
-void worker_fun(actor_ptr msgcollector)
-{
+void worker_fun(actor_ptr msgcollector) {
bool done = false;
- do_receive
- (
- on() >> [&](uint64_t what)
- {
+ do_receive (
+ on() >> [&](uint64_t what) {
send(msgcollector, atom("result"), factorize(what));
},
- on(atom("done")) >> [&]()
- {
+ on(atom("done")) >> [&]() {
done = true;
}
)
.until([&]() { return done == true; });
}
-actor_ptr new_ring(actor_ptr next, int ring_size)
-{
+actor_ptr new_ring(actor_ptr next, int ring_size) {
for (int i = 1; i < ring_size; ++i) next = spawn(chain_link, next);
return next;
}
-void chain_master(actor_ptr msgcollector)
-{
+void chain_master(actor_ptr msgcollector) {
auto worker = spawn(worker_fun, msgcollector);
- receive
- (
- on() >> [&](int rs, int itv, int n)
- {
+ receive (
+ on(atom("init"), arg_match) >> [&](int rs, int itv, int n) {
int iteration = 0;
auto next = new_ring(self, rs);
send(next, atom("token"), itv);
send(worker, atom("calc"), s_task_n);
- do_receive
- (
- on() >> [&](int v)
- {
- if (v == 0)
- {
- if (++iteration < n)
- {
+ do_receive (
+ on() >> [&](int v) {
+ if (v == 0) {
+ if (++iteration < n) {
next = new_ring(self, rs);
send(next, atom("token"), itv);
send(worker, atom("calc"), s_task_n);
}
}
- else
- {
+ else {
send(next, atom("token"), v - 1);
}
}
@@ -316,16 +207,12 @@ void chain_master(actor_ptr msgcollector)
send(worker, atom("done"));
}
-void supervisor(int num_msgs)
-{
- do_receive
- (
- on(atom("masterdone")) >> [&]()
- {
+void supervisor(int num_msgs) {
+ do_receive (
+ on(atom("masterdone")) >> [&]() {
--num_msgs;
},
- on() >> [&](const factors& vec)
- {
+ on() >> [&](const factors& vec) {
--num_msgs;
check_factors(vec);
}
@@ -334,16 +221,14 @@ void supervisor(int num_msgs)
}
template
-void run_test(F&& spawn_impl,
+void run_test(F spawn_impl,
int num_rings, int ring_size,
- int initial_token_value, int repetitions)
-{
+ int initial_token_value, int repetitions) {
std::vector masters; // of the universe
// each master sends one masterdone message and one
// factorization is calculated per repetition
//auto supermaster = spawn(supervisor, num_rings+repetitions);
- for (int i = 0; i < num_rings; ++i)
- {
+ for (int i = 0; i < num_rings; ++i) {
masters.push_back(spawn_impl());
send(masters.back(), atom("init"),
ring_size,
@@ -353,9 +238,8 @@ void run_test(F&& spawn_impl,
await_all_others_done();
}
-void usage()
-{
- cout << "usage: mailbox_performance [--boost_pool] "
+void usage() {
+ cout << "usage: mailbox_performance "
"(stacked|event-based) (num rings) (ring size) "
"(initial token value) (repetitions)"
<< endl
@@ -365,46 +249,42 @@ void usage()
enum mode_type { event_based, fiber_based };
-int main(int argc, char** argv)
-{
+option _2i(const std::string& str) {
+ char* endptr = nullptr;
+ int result = static_cast(strtol(str.c_str(), &endptr, 10));
+ if (endptr == nullptr || *endptr != '\0') {
+ return {};
+ }
+ return result;
+}
+
+int main(int argc, char** argv) {
announce();
if (argc != 6) usage();
- auto iter = argv;
- ++iter; // argv[0] (app name)
- /*
- if (argc == 7)
- {
- if (strcmp(*iter++, "--boost_pool") == 0)
- cppa::set_scheduler(new cppa::detail::boost_threadpool_scheduler);
- else usage();
- }
- */
- mode_type mode;
- std::string mode_str = *iter++;
- if (mode_str == "event-based") mode = event_based;
- else if (mode_str == "stacked") mode = fiber_based;
- else usage();
- int num_rings = rd(*iter++);
- int ring_size = rd(*iter++);
- int initial_token_value = rd(*iter++);
- int repetitions = rd(*iter++);
- int num_msgs = num_rings + (num_rings * repetitions);
- switch (mode)
- {
- case event_based:
- {
- auto mc = spawn(new fsm_supervisor(num_msgs));
- run_test([&]() { return spawn(new fsm_chain_master(mc)); },
- num_rings, ring_size, initial_token_value, repetitions);
- break;
- }
- case fiber_based:
- {
- auto mc = spawn(supervisor, num_msgs);
- run_test([&]() { return spawn(chain_master, mc); },
- num_rings, ring_size, initial_token_value, repetitions);
- break;
- }
- }
+ // skip argv[0] (app name)
+ std::vector args{argv + 1, argv + argc};
+ match(args) (
+ on(val, _2i, _2i, _2i, _2i) >> [](const std::string& mode,
+ int num_rings,
+ int ring_size,
+ int initial_token_value,
+ int repetitions) {
+ int num_msgs = num_rings + (num_rings * repetitions);
+ if (mode == "event-based") {
+ auto mc = spawn(num_msgs);
+ run_test([&]() { return spawn(mc); },
+ num_rings, ring_size, initial_token_value, repetitions);
+ }
+ else if (mode == "stacked") {
+ auto mc = spawn(supervisor, num_msgs);
+ run_test([&]() { return spawn(chain_master, mc); },
+ num_rings, ring_size, initial_token_value, repetitions);
+ }
+ else {
+ usage();
+ }
+ },
+ others() >> usage
+ );
return 0;
}
diff --git a/benchmarks/mixed_case_libprocess.cpp b/benchmarks/mixed_case_libprocess.cpp
new file mode 100644
index 0000000000..f2ad2c5de0
--- /dev/null
+++ b/benchmarks/mixed_case_libprocess.cpp
@@ -0,0 +1,186 @@
+#include
+#include
+
+#include "utility.hpp"
+
+typedef std::vector factors;
+constexpr uint64_t s_task_n = uint64_t(86028157)*329545133;
+constexpr uint64_t s_factor1 = 86028157;
+constexpr uint64_t s_factor2 = 329545133;
+
+void check_factors(const factors& vec)
+{
+ assert(vec.size() == 2);
+ assert(vec[0] == s_factor1);
+ assert(vec[1] == s_factor2);
+}
+
+class supervisor : public process::Process
+{
+public:
+ supervisor(int num_msgs)
+ : left_(num_msgs)
+ {
+ }
+
+ void subtract()
+ {
+ if (--left_ == 0)
+ process::terminate(self());
+ }
+
+ void check(const factors& vec)
+ {
+ check_factors(vec);
+ if (--left_ == 0)
+ process::terminate(self());
+ }
+
+private:
+ int left_;
+};
+
+class chain_link : public process::Process
+{
+public:
+ chain_link()
+ {
+ }
+
+ chain_link(process::PID pid)
+ : next_(std::move(pid))
+ {
+ }
+
+ virtual ~chain_link() { }
+
+ virtual void token(int v)
+ {
+ assert(next_);
+ process::dispatch(next_, &chain_link::token, v);
+ if (v == 0)
+ process::terminate(self());
+ }
+
+private:
+ process::PID next_;
+};
+
+class worker : public process::Process
+{
+public:
+ worker(process::PID collector)
+ : collector_(std::move(collector))
+ {
+ }
+
+ void calc(uint64_t what)
+ {
+ process::dispatch(collector_, &supervisor::check, factorize(what));
+ }
+
+ void done()
+ {
+ process::terminate(self());
+ }
+
+private:
+ process::PID collector_;
+};
+
+class chain_master : public chain_link
+{
+public:
+ chain_master(process::PID collector, int rs, int itv, int n)
+ : chain_link()
+ , ring_size_(rs)
+ , initial_value_(itv)
+ , repetitions_(n)
+ , iteration_(0)
+ , collector_(collector)
+ {
+ }
+
+ void new_ring(int ring_size, int initial_token_value)
+ {
+ process::dispatch(worker_, &worker::calc, s_task_n);
+ next_ = self();
+ for (int i = 1; i < ring_size; ++i)
+ next_ = process::spawn(new chain_link(next_), true);
+
+ process::dispatch(next_, &chain_link::token, initial_token_value);
+ }
+
+ void init()
+ {
+ worker_ = process::spawn(new worker(collector_), true);
+ new_ring(ring_size_, initial_value_);
+ }
+
+ virtual void token(int t)
+ {
+ if (t == 0)
+ {
+ if (++iteration_ < repetitions_)
+ {
+ new_ring(ring_size_, initial_value_);
+ }
+ else
+ {
+ dispatch(worker_, &worker::done);
+ dispatch(collector_, &supervisor::subtract);
+ process::terminate(self());
+ }
+ }
+ else
+ {
+ process::dispatch(next_, &chain_link::token, t - 1);
+ }
+ }
+
+private:
+ const int ring_size_;
+ const int initial_value_;
+ const int repetitions_;
+ int iteration_;
+ process::PID collector_;
+ process::PID next_;
+ process::PID worker_;
+};
+
+int main(int argc, char** argv)
+{
+ if (argc != 5)
+ {
+ std::cout << "usage " << argv[0] << ": " <<
+ "(num rings) (ring size) (initial token value) (repetitions)"
+ << std::endl;
+
+ return 1;
+ }
+
+ auto iter = argv;
+ ++iter; // argv[0] (app name)
+ int num_rings = rd(*iter++);
+ int ring_size = rd(*iter++);
+ int initial_token_value = rd(*iter++);
+ int repetitions = rd(*iter++);
+ int num_msgs = num_rings + (num_rings * repetitions);
+
+ auto mc = process::spawn(new supervisor(num_msgs), true);
+ std::vector> masters;
+ for (int i = 0; i < num_rings; ++i)
+ {
+ auto master = process::spawn(
+ new chain_master(mc, ring_size, initial_token_value, repetitions),
+ true);
+
+ process::dispatch(master, &chain_master::init);
+ masters.push_back(master);
+ }
+
+ for (auto& m : masters)
+ process::wait(m);
+
+ return 0;
+}
diff --git a/benchmarks/mk_mixed_case_libprocess.sh b/benchmarks/mk_mixed_case_libprocess.sh
new file mode 100755
index 0000000000..2147b32692
--- /dev/null
+++ b/benchmarks/mk_mixed_case_libprocess.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# quick & dirty: eval args to enable CXX=... and CXXFLAGS=...
+for arg in "$@"; do
+ eval "$arg"
+done
+
+if test "" = "$CXX"; then
+ CXX=g++
+fi
+
+function verbose_exec {
+ echo $1
+ eval $1
+ if test "0" != "$?" ; then
+ echo ; echo "command failed!"
+ exit
+ fi
+}
+
+function check_var {
+ if test "" = "$1" ; then
+ echo "something went wrong ... $2 not found"
+ exit
+ fi
+}
+
+function fetch_lib {
+ find mesos/third_party/libprocess -name "$1"
+ if test "$2" = "true" ; then
+ echo "something went wrong ... $1 not found"
+ fi
+}
+
+if ! test -d mesos ; then
+ echo "fetch mesos (for libprocess)"
+ verbose_exec "git clone https://github.com/apache/mesos.git"
+else
+ echo "found mesos repository"
+fi
+
+LIBFILE=$(fetch_lib libprocess.a)
+LIBGLOGFILE=$(fetch_lib libglog.a)
+LIBEVFILE=$(fetch_lib libev.a)
+
+echo "LIBFILE=$LIBFILE"
+echo "LIBGLOGFILE=$LIBGLOGFILE"
+echo "LIBEVFILE=$LIBEVFILE"
+
+if test "" = "$LIBFILE" -o "" = "$LIBGLOGFILE" -o "" = "$LIBEVFILE" ; then
+ CURR=$PWD
+ echo "build libprocess"
+ cd mesos/third_party/libprocess/
+ verbose_exec "autoreconf -Wnone -i && ./configure CXX=\"$CXX\" CXXFLAGS=\"$CXXFLAGS -D_XOPEN_SOURCE\" && make"
+ echo "build third_party libraries"
+ cd third_party
+ for dir in * ; do
+ if test -d $dir ; then
+ # skip boost in third_party directory
+ if [[ "$dir" == glog* ]] || [[ "$dir" == libev* ]] ; then
+ echo "cd $dir"
+ cd $dir
+ verbose_exec "autoreconf -i ; ./configure CXX=\"$CXX\" CXXFLAGS=\"$CXXFLAGS\" ; make"
+ echo "cd .."
+ cd ..
+ fi
+ fi
+ done
+ cd $CURR
+ LIBFILE=$(fetch_lib libprocess.a true)
+ LIBGLOGFILE=$(fetch_lib libglog.a true)
+ LIBEVFILE=$(fetch_lib libev.a true)
+else
+ echo "found libprocess library: $LIBFILE"
+fi
+LIBDIRS="-L$(dirname "$LIBFILE") -L$(dirname "$LIBGLOGFILE") -L$(dirname "$LIBEVFILE")"
+
+verbose_exec "$CXX --std=c++0x $CXXFLAGS -Imesos/third_party/libprocess/include/ $LIBDIRS mixed_case_libprocess.cpp -o mixed_case_libprocess -lprocess -lglog -lev"
+
diff --git a/benchmarks/mk_scala.sh b/benchmarks/mk_scala.sh
index 091938d0de..b5c6b42100 100755
--- a/benchmarks/mk_scala.sh
+++ b/benchmarks/mk_scala.sh
@@ -1,11 +1,11 @@
#!/bin/bash
if [[ $# -eq 0 ]] ; then
for i in *.scala; do
- echo "scalac -cp ../../akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar \"$i\""
- scalac -cp ../../akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar "$i"
+ echo "compile \"$i\""
+ scalac -unchecked -cp $AKKA_LIBS "$i"
done
elif [[ $# -eq 1 ]] ; then
- echo "scalac -cp ../../akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar \"$1.scala\""
- scalac -cp ../../akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar "$1.scala"
+ echo "compile \"$1.scala\""
+ scalac -unchecked -cp $AKKA_LIBS "$1.scala"
fi
echo done
diff --git a/benchmarks/scala_test.sh b/benchmarks/scala_test.sh
index a0adcd00d0..29d21357eb 100755
--- a/benchmarks/scala_test.sh
+++ b/benchmarks/scala_test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
#export JAVA_OPTS="-Xmx1024"
#echo "scala -cp /home/neverlord/akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar $@" | ./exec.sh
-echo "scala -cp /home/neverlord/akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar $@" | ./exec.sh
+JARS=/home/neverlord/akka-microkernel-1.2/lib/akka/activation-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-actor-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-actor-tests-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-amqp-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-beanstalk-mailbox-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-camel-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-camel-typed-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-dispatcher-extras-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-file-mailbox-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-http-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-kernel-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-mailboxes-common-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-redis-mailbox-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-remote-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-scalaz-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-slf4j-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-spring-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-stm-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-testkit-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/akka-typed-actor-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/amqp-client-2.5.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/aopalliance-1.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/asm-3.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/aspectwerkz-2.2.3.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/beanstalk_client-1.4.5.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/camel-core-2.7.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-cli-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-codec-1.4.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-io-2.0.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-logging-1.1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-management-1.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/commons-pool-1.5.5.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/dispatch-json_2.9.0-0.8.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/guice-all-2.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/h2-lzf-1.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/hawtdispatch-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/hawtdispatch-scala-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jackson-core-asl-1.8.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jackson-mapper-asl-1.8.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jaxb-api-2.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jaxb-impl-2.1.12.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jersey-core-1.3.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jersey-json-1.3.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jersey-scala-1.3.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jersey-server-1.3.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jettison-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-continuation-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-http-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-io-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-security-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-server-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-servlet-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-util-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jetty-xml-7.4.0.v20110414.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jsr250-api-1.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jsr311-api-1.1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/jsr311-api-1.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/junit-4.8.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/log4j-1.2.16.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/multiverse-alpha-0.6.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/netty-3.2.5.Final.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/objenesis-1.2.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/protobuf-java-2.4.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/redisclient_2.9.0-2.3.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/scalaz-core_2.9.0-1-6.0.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/servlet-api-2.5.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/sjson_2.9.0-0.11.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/slf4j-api-1.5.8.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/slf4j-api-1.6.0.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/slf4j-log4j12-1.5.8.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-aop-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-asm-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-beans-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-context-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-core-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/spring-expression-3.0.5.RELEASE.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/stax-api-1.0.1.jar:/home/neverlord/akka-microkernel-1.2/lib/akka/stax-api-1.0-2.jar
+echo "scala -cp $JARS $@" | ./exec.sh
diff --git a/benchmarks/theron_actor_creation.cpp b/benchmarks/theron_actor_creation.cpp
index 0bd29f4baa..825a737997 100644
--- a/benchmarks/theron_actor_creation.cpp
+++ b/benchmarks/theron_actor_creation.cpp
@@ -18,41 +18,33 @@ struct result { uint32_t value; };
using namespace Theron;
-struct testee : Actor
-{
+struct testee : Actor {
Address m_parent;
bool m_first_result_received;
uint32_t m_first_result;
std::vector m_children;
- void spread_handler(const spread& arg, const Address)
- {
- if (arg.value == 0)
- {
+ void spread_handler(const spread& arg, const Address) {
+ if (arg.value == 0) {
Send(result{1}, m_parent);
}
- else
- {
+ else {
spread msg = {arg.value-1};
Parameters params = {GetAddress()};
- for (int i = 0; i < 2; ++i)
- {
+ for (int i = 0; i < 2; ++i) {
m_children.push_back(GetFramework().CreateActor(params));
m_children.back().Push(msg, GetAddress());
}
}
}
- void result_handler(const result& arg, const Address)
- {
- if (!m_first_result_received)
- {
+ void result_handler(const result& arg, const Address) {
+ if (!m_first_result_received) {
m_first_result_received = true;
m_first_result = arg.value;
}
- else
- {
+ else {
m_children.clear();
Send(result{m_first_result + arg.value}, m_parent);
}
@@ -60,25 +52,21 @@ struct testee : Actor
typedef struct { Address arg0; } Parameters;
- testee(const Parameters& p) : m_parent(p.arg0), m_first_result_received(false)
- {
+ testee(const Parameters& p) : m_parent(p.arg0), m_first_result_received(false) {
RegisterHandler(this, &testee::spread_handler);
RegisterHandler(this, &testee::result_handler);
}
};
-void usage()
-{
+void usage() {
cout << "usage: theron_actor_creation _ POW" << endl
<< " creates 2^POW actors" << endl
<< endl;
}
-int main(int argc, char** argv)
-{
- if (argc != 3)
- {
+int main(int argc, char** argv) {
+ if (argc != 3) {
usage();
return 1;
}
diff --git a/benchmarks/theron_mailbox_performance.cpp b/benchmarks/theron_mailbox_performance.cpp
index a876c7de9d..4665f88b99 100644
--- a/benchmarks/theron_mailbox_performance.cpp
+++ b/benchmarks/theron_mailbox_performance.cpp
@@ -18,47 +18,39 @@ using namespace Theron;
int64_t t_max = 0;
-struct receiver : Actor
-{
+struct receiver : Actor {
int64_t m_num;
- void handler(const int64_t&, const Address from)
- {
+ void handler(const int64_t&, const Address from) {
if (++m_num == t_max)
Send(t_max, from);
}
- receiver() : m_num(0)
- {
+ receiver() : m_num(0) {
RegisterHandler(this, &receiver::handler);
}
};
-void send_sender(Framework& f, ActorRef ref, Address waiter, int64_t num)
-{
+void send_sender(Framework& f, ActorRef ref, Address waiter, int64_t num) {
auto addr = ref.GetAddress();
int64_t msg;
for (int64_t i = 0; i < num; ++i) f.Send(msg, waiter, addr);
}
-void push_sender(Framework& f, ActorRef ref, Address waiter, int64_t num)
-{
+void push_sender(Framework& f, ActorRef ref, Address waiter, int64_t num) {
int64_t msg;
for (int64_t i = 0; i < num; ++i) ref.Push(msg, waiter);
}
-void usage()
-{
+void usage() {
cout << "usage ('push'|'send') (num_threads) (num_messages)" << endl;
exit(1);
}
-int main(int argc, char** argv)
-{
- if (argc != 4)
- {
+int main(int argc, char** argv) {
+ if (argc != 4) {
usage();
}
enum { invalid_impl, push_impl, send_impl } impl = invalid_impl;
@@ -74,8 +66,7 @@ int main(int argc, char** argv)
ActorRef aref(framework.CreateActor());
std::list threads;
auto impl_fun = (impl == push_impl) ? send_sender : push_sender;
- for (int64_t i = 0; i < num_sender; ++i)
- {
+ for (int64_t i = 0; i < num_sender; ++i) {
threads.push_back(std::thread(impl_fun, std::ref(framework), aref, receiverAddr, num_msgs));
}
r.Wait();
diff --git a/benchmarks/theron_mixed_case.cpp b/benchmarks/theron_mixed_case.cpp
index fcd23969e0..ab0dce9c91 100644
--- a/benchmarks/theron_mixed_case.cpp
+++ b/benchmarks/theron_mixed_case.cpp
@@ -30,40 +30,32 @@ struct master_done { };
struct worker_done { };
-struct worker : Actor
-{
- void handle_calc(const calc_msg& msg, Address from)
- {
+struct worker : Actor {
+ void handle_calc(const calc_msg& msg, Address from) {
factorize(msg.value);
}
- void handle_master_done(const master_done&, Address from)
- {
+ void handle_master_done(const master_done&, Address from) {
Send(worker_done(), from);
}
- worker()
- {
+ worker() {
RegisterHandler(this, &worker::handle_calc);
RegisterHandler(this, &worker::handle_master_done);
}
};
-struct chain_link : Actor
-{
+struct chain_link : Actor {
Address next;
- void handle_token(const token_msg& msg, Address)
- {
+ void handle_token(const token_msg& msg, Address) {
Send(msg, next);
}
typedef struct { Address next; } Parameters;
- chain_link(const Parameters& p) : next(p.next)
- {
+ chain_link(const Parameters& p) : next(p.next) {
RegisterHandler(this, &chain_link::handle_token);
}
};
-struct master : Actor
-{
+struct master : Actor {
Address mc;
int iteration;
int max_iterations;
@@ -72,20 +64,17 @@ struct master : Actor
int ring_size;
int initial_token_value;
std::vector m_children;
- void new_ring()
- {
+ void new_ring() {
m_children.clear();
w.Push(calc_msg{s_task_n}, GetAddress());
next = GetAddress();
- for (int i = 1; i < ring_size; ++i)
- {
+ for (int i = 1; i < ring_size; ++i) {
m_children.push_back(GetFramework().CreateActor(chain_link::Parameters{next}));
next = m_children.back().GetAddress();
}
Send(token_msg{initial_token_value}, next);
}
- void handle_init(const init_msg& msg, Address)
- {
+ void handle_init(const init_msg& msg, Address) {
w = GetFramework().CreateActor();
iteration = 0;
ring_size = msg.ring_size;
@@ -93,40 +82,32 @@ struct master : Actor
max_iterations = msg.iterations;
new_ring();
}
- void handle_token(const token_msg& msg, Address)
- {
- if (msg.value == 0)
- {
- if (++iteration < max_iterations)
- {
+ void handle_token(const token_msg& msg, Address) {
+ if (msg.value == 0) {
+ if (++iteration < max_iterations) {
new_ring();
}
- else
- {
+ else {
w.Push(master_done(), GetAddress());
}
}
- else
- {
+ else {
Send(token_msg{msg.value - 1}, next);
}
}
- void handle_worker_done(const worker_done&, Address)
- {
+ void handle_worker_done(const worker_done&, Address) {
Send(master_done(), mc);
w = ActorRef::Null();
}
typedef struct { Address mc; } Parameters;
- master(const Parameters& p) : mc(p.mc), iteration(0)
- {
+ master(const Parameters& p) : mc(p.mc), iteration(0) {
RegisterHandler(this, &master::handle_init);
RegisterHandler(this, &master::handle_token);
RegisterHandler(this, &master::handle_worker_done);
}
};
-void usage()
-{
+void usage() {
cout << "usage: mailbox_performance "
"'send' (num rings) (ring size) "
"(initial token value) (repetitions)"
@@ -135,8 +116,7 @@ void usage()
exit(1);
}
-int main(int argc, char** argv)
-{
+int main(int argc, char** argv) {
if (argc != 6) usage();
if (strcmp("send", argv[1]) != 0) usage();
int num_rings = rd(argv[2]);
@@ -146,12 +126,10 @@ int main(int argc, char** argv)
Receiver r;
Framework framework(num_cores());
std::vector masters;
- for (int i = 0; i < num_rings; ++i)
- {
+ for (int i = 0; i < num_rings; ++i) {
masters.push_back(framework.CreateActor(master::Parameters{r.GetAddress()}));
}
- for (ActorRef& m : masters)
- {
+ for (ActorRef& m : masters) {
m.Push(init_msg{ring_size, inital_token_value, repetitions}, r.GetAddress());
}
for (int i = 0; i < num_rings; ++i) r.Wait();
diff --git a/benchmarks/utility.hpp b/benchmarks/utility.hpp
index 44a5e09be2..f38e2b420b 100644
--- a/benchmarks/utility.hpp
+++ b/benchmarks/utility.hpp
@@ -32,18 +32,35 @@
#define UTILITY_HPP
#include
+#include
+#include
#include
#include
-#include "boost/thread.hpp"
+inline std::vector split(const std::string& str, char delim) {
+ std::vector result;
+ std::stringstream strs{str};
+ std::string tmp;
+ while (std::getline(strs, tmp, delim)) result.push_back(tmp);
+ return result;
+}
+
+inline std::string join(const std::vector& vec,
+ const std::string& delim = "") {
+ if (vec.empty()) return "";
+ auto result = vec.front();
+ for (auto i = vec.begin() + 1; i != vec.end(); ++i) {
+ result += delim;
+ result += *i;
+ }
+ return result;
+}
template
-T rd(char const* cstr)
-{
+T rd(const char* cstr) {
char* endptr = nullptr;
T result = static_cast(strtol(cstr, &endptr, 10));
- if (endptr == nullptr || *endptr != '\0')
- {
+ if (endptr == nullptr || *endptr != '\0') {
std::string errstr;
errstr += "\"";
errstr += cstr;
@@ -53,18 +70,10 @@ T rd(char const* cstr)
return result;
}
-#ifdef __APPLE__
-int num_cores()
-{
- return static_cast(boost::thread::hardware_concurrency());
-}
-#else
-int num_cores()
-{
+int num_cores() {
char cbuf[100];
FILE* cmd = popen("/bin/cat /proc/cpuinfo | /bin/grep processor | /usr/bin/wc -l", "r");
- if (fgets(cbuf, 100, cmd) == 0)
- {
+ if (fgets(cbuf, 100, cmd) == 0) {
throw std::runtime_error("cannot determine number of cores");
}
pclose(cmd);
@@ -73,26 +82,20 @@ int num_cores()
*i = '\0';
return rd(cbuf);
}
-#endif
-std::vector factorize(uint64_t n)
-{
+std::vector factorize(uint64_t n) {
std::vector result;
- if (n <= 3)
- {
+ if (n <= 3) {
result.push_back(n);
return std::move(result);
}
uint64_t d = 2;
- while(d < n)
- {
- if((n % d) == 0)
- {
+ while(d < n) {
+ if((n % d) == 0) {
result.push_back(d);
n /= d;
}
- else
- {
+ else {
d = (d == 2) ? 3 : (d + 2);
}
}
diff --git a/blob/AUTHORS b/blob/AUTHORS
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/blob/COPYING b/blob/COPYING
deleted file mode 100644
index 94a9ed024d..0000000000
--- a/blob/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/blob/ChangeLog b/blob/ChangeLog
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/blob/Makefile.am b/blob/Makefile.am
deleted file mode 100644
index 1976de1270..0000000000
--- a/blob/Makefile.am
+++ /dev/null
@@ -1,84 +0,0 @@
-ACLOCAL_AMFLAGS = -I ../m4
-
-bin_PROGRAMS = cppatest
-
-cppatest_SOURCES = \
- ../src/abstract_tuple.cpp \
- ../src/abstract_type_list.cpp \
- ../src/actor_behavior.cpp \
- ../src/actor_count.cpp \
- ../src/actor.cpp \
- ../src/actor_proxy_cache.cpp \
- ../src/actor_proxy.cpp \
- ../src/actor_registry.cpp \
- ../src/addressed_message.cpp \
- ../src/any_tuple.cpp \
- ../src/any_tuple_iterator.cpp \
- ../src/atom.cpp \
- ../src/attachable.cpp \
- ../src/binary_deserializer.cpp \
- ../src/binary_serializer.cpp \
- ../src/blocking_message_queue.cpp \
- ../src/channel.cpp \
- ../src/local_actor.cpp \
- ../src/converted_thread_context.cpp \
- ../src/cppa.cpp \
- ../src/delegate.cpp \
- ../src/demangle.cpp \
- ../src/deserializer.cpp \
- ../src/duration.cpp \
- ../src/empty_tuple.cpp \
- ../src/exception.cpp \
- ../src/fiber.cpp \
- ../src/group.cpp \
- ../src/group_manager.cpp \
- ../src/intermediate.cpp \
- ../src/invokable.cpp \
- ../src/invoke_rules.cpp \
- ../src/mailman.cpp \
- ../src/matcher_arguments.cpp \
- ../src/message_queue.cpp \
- ../src/mock_scheduler.cpp \
- ../src/native_socket.cpp \
- ../src/network_manager.cpp \
- ../src/object_array.cpp \
- ../src/object.cpp \
- ../src/post_office.cpp \
- ../src/post_office_msg.cpp \
- ../src/primitive_variant.cpp \
- ../src/process_information.cpp \
- ../src/ripemd_160.cpp \
- ../src/scheduled_actor.cpp \
- ../src/scheduler.cpp \
- ../src/serializer.cpp \
- ../src/shared_spinlock.cpp \
- ../src/singleton_manager.cpp \
- ../src/string_serialization.cpp \
- ../src/task_scheduler.cpp \
- ../src/thread_pool_scheduler.cpp \
- ../src/to_uniform_name.cpp \
- ../src/unicast_network.cpp \
- ../src/uniform_type_info.cpp \
- ../src/yielding_message_queue.cpp \
- ../src/yield_interface.cpp \
- ../unit_testing/hash_of.cpp \
- ../unit_testing/main.cpp \
- ../unit_testing/ping_pong.cpp \
- ../unit_testing/test__a_matches_b.cpp \
- ../unit_testing/test__atom.cpp \
- ../unit_testing/test__intrusive_ptr.cpp \
- ../unit_testing/test__local_group.cpp \
- ../unit_testing/test__primitive_variant.cpp \
- ../unit_testing/test__remote_actor.cpp \
- ../unit_testing/test__ripemd_160.cpp \
- ../unit_testing/test__serialization.cpp \
- ../unit_testing/test__spawn.cpp \
- ../unit_testing/test__tuple.cpp \
- ../unit_testing/test__type_list.cpp \
- ../unit_testing/test__uniform_type.cpp \
- ../unit_testing/test__yield_interface.cpp
-
-AM_CPPFLAGS = -I../
-cppatest_CXXFLAGS = --std=c++0x -pedantic -Wall -Wextra
-#AM_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
-cppatest_LDADD = $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
diff --git a/blob/NEWS b/blob/NEWS
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/blob/README b/blob/README
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/blob/c_context_impl.c b/blob/c_context_impl.c
deleted file mode 100644
index ca73befb7b..0000000000
--- a/blob/c_context_impl.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE
-#endif
-
-#include
-
-#include
-#include
-#include
-#include
-
-static ucontext_t ctx[2];
-
-__thread int m_count = 0;
-
-void coroutine()
-{
- for (;;)
- {
- ++m_count;
- printf("m_count = %i\n", m_count);
- swapcontext(&ctx[1], &ctx[0]);
- }
-}
-
-int main(int argc, char** argv)
-{
- int i;
- void* coroutine_stack = mmap(0,
- SIGSTKSZ,
- PROT_EXEC | PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0);
-
- memset(&ctx[0], 0, sizeof(ucontext_t));
- getcontext(&ctx[0]);
-
- memset(&ctx[1], 0, sizeof(ucontext_t));
- getcontext(&ctx[1]);
- ctx[1].uc_stack.ss_sp = coroutine_stack;
- ctx[1].uc_stack.ss_size = SIGSTKSZ;
- ctx[1].uc_link = &ctx[0];
- makecontext(&ctx[1], coroutine, 0);
-
- for (i = 1; i < 11; ++i)
- {
- printf("i = %i\n", i);
- swapcontext(&ctx[0], &ctx[1]);
- }
-
- munmap(coroutine_stack, SIGSTKSZ);
-
- return 0;
-}
-
diff --git a/blob/configure.ac b/blob/configure.ac
deleted file mode 100644
index 9dd7c4e74d..0000000000
--- a/blob/configure.ac
+++ /dev/null
@@ -1,13 +0,0 @@
-AC_PREREQ([2.6])
-AC_INIT([cppatest], [0.1])
-AM_INIT_AUTOMAKE(@PACKAGE_NAME@, @PACKAGE_VERSION@)
-AC_CONFIG_MACRO_DIR([../m4])
-
-AC_PROG_CXX
-
-# check for boost and boost_thread
-AX_BOOST_BASE([1.42.0])
-AX_BOOST_THREAD
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
diff --git a/blob/context_impl_test.cpp b/blob/context_impl_test.cpp
deleted file mode 100644
index 741f16d776..0000000000
--- a/blob/context_impl_test.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include
-#include "cppa_fibre.h"
-
-using std::cout;
-using std::endl;
-
-struct pseudo_worker
-{
- int m_value;
-
- pseudo_worker() : m_value(0) { }
-
- void operator()()
- {
- for (;;)
- {
- ++m_value;
- cout << "value = " << m_value << endl;
- cppa_fibre_yield(0);
- }
- }
-};
-
-void coroutine()
-{
- auto pw = reinterpret_cast(cppa_fibre_init_switch_arg());
- (*pw)();
-}
-
-int main()
-{
- pseudo_worker pw;
- cppa_fibre fself;
- cppa_fibre fcoroutine;
- cppa_fibre_ctor(&fself);
- cppa_fibre_ctor2(&fcoroutine, coroutine, &pw);
- cppa_fibre_initialize(&fcoroutine);
- for (int i = 1; i < 11; ++i)
- {
- cout << "i = " << i << endl;
- cppa_fibre_switch(&fself, &fcoroutine);
- }
- cppa_fibre_dtor(&fself);
- cppa_fibre_dtor(&fcoroutine);
- return 0;
-}
diff --git a/blob/cppa_fibre.c b/blob/cppa_fibre.c
deleted file mode 100644
index ad1e6801f5..0000000000
--- a/blob/cppa_fibre.c
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "cppa_fibre.h"
-
-__thread void* s_switch_arg;
-__thread int s_yield_value;
-__thread ucontext_t* s_caller;
-__thread ucontext_t* s_callee;
-
-void cppa_fibre_ctor(cppa_fibre* instance)
-{
- instance->m_state = 0;
- memset(&(instance->m_context), 0, sizeof(ucontext_t));
- getcontext(&(instance->m_context));
- instance->m_fun = 0;
- instance->m_init_arg = 0;
-}
-
-void cppa_fibre_ctor2(cppa_fibre* instance, void (*fun)(), void* arg)
-{
- cppa_fibre_ctor(instance);
- instance->m_state = 1;
- instance->m_fun = fun;
- instance->m_init_arg = arg;
-}
-
-void cppa_fibre_initialize(cppa_fibre* instance)
-{
- if (instance->m_state == 1)
- {
- instance->m_state = 2;
- instance->m_context.uc_stack.ss_sp = mmap(0,
- SIGSTKSZ,
- PROT_EXEC | PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0);
- instance->m_context.uc_stack.ss_size = SIGSTKSZ;
- makecontext(&(instance->m_context), instance->m_fun, 0);
- s_switch_arg = instance->m_init_arg;
- }
-}
-
-void cppa_fibre_dtor(cppa_fibre* instance)
-{
- if (instance->m_state == 2)
- {
- munmap(instance->m_context.uc_stack.ss_sp, SIGSTKSZ);
- }
-}
-
-void* cppa_fibre_init_switch_arg()
-{
- return s_switch_arg;
-}
-
-void cppa_fibre_switch(cppa_fibre* from, cppa_fibre* to)
-{
- ucontext_t* ctx_from = &(from->m_context);
- ucontext_t* ctx_to = &(to->m_context);
- s_caller = ctx_from;
- s_callee = ctx_to;
- swapcontext(ctx_from, ctx_to);
-}
-
-void cppa_fibre_yield(int value)
-{
- s_yield_value = value;
- swapcontext(s_callee, s_caller);
-}
-
-int cppa_fibre_yielded_value()
-{
- return s_yield_value;
-}
diff --git a/blob/cppa_fibre.h b/blob/cppa_fibre.h
deleted file mode 100644
index 9bffe493cc..0000000000
--- a/blob/cppa_fibre.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef CPPA_FIBRE_H
-#define CPPA_FIBRE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE
-#endif
-
-#include
-#include
-
-struct cppa_fibre_struct
-{
- // 0: *this* context
- // 1: fibre with function to execute, no stack assigned yet
- // 2: as 1 but with assigned stack
- int m_state;
- ucontext_t m_context;
- void (*m_fun)();
- void* m_init_arg;
-};
-
-typedef struct cppa_fibre_struct cppa_fibre;
-
-void cppa_fibre_ctor(cppa_fibre* instance);
-
-/*
- * @brief Initializes the given fibre.
- * @param instance Pointer to an uninitialized object.
- * @param fun Function this fibre should execute.
- * @param switch_arg This pointer is stored in a
- * thread-local variable on first
- * context switch to @p instance.
- */
-void cppa_fibre_ctor2(cppa_fibre* instance,
- void (*fun)(),
- void* switch_arg);
-
-/*
- * @warning call directly before the first switch
- */
-void cppa_fibre_initialize(cppa_fibre* instance);
-
-void cppa_fibre_dtor(cppa_fibre* instance);
-
-/*
- * @brief Returns
- */
-void* cppa_fibre_init_switch_arg();
-
-void cppa_fibre_switch(cppa_fibre* from, cppa_fibre* to);
-
-/*
- * Switches back to the calling fibre.
- */
-void cppa_fibre_yield(int value);
-
-/*
- * Gets the yielded value of the client fibre.
- */
-int cppa_fibre_yielded_value();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
new file mode 100644
index 0000000000..10ff29ed2b
--- /dev/null
+++ b/cmake_uninstall.cmake.in
@@ -0,0 +1,24 @@
+if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest:
+\"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+list(REVERSE files)
+foreach (file ${files})
+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if (EXISTS "$ENV{DESTDIR}${file}")
+ execute_process(
+ COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+ OUTPUT_VARIABLE rm_out
+ RESULT_VARIABLE rm_retval
+ )
+ if(NOT ${rm_retval} EQUAL 0)
+ message(FATAL_ERROR "Problem when removing
+\"$ENV{DESTDIR}${file}\"")
+ endif (NOT ${rm_retval} EQUAL 0)
+ else (EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index a106f6ac10..0000000000
--- a/configure.ac
+++ /dev/null
@@ -1,46 +0,0 @@
-AC_PREREQ([2.6])
-AC_INIT([libcppa], [0.1])
-AM_INIT_AUTOMAKE(@PACKAGE_NAME@, @PACKAGE_VERSION@)
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_SRCDIR([src])
-
-AC_PROG_CXX
-
-# check for boost and boost_thread
-AX_BOOST_BASE([1.42.0])
-AX_BOOST_THREAD
-
-AC_PROG_LIBTOOL
-
-# check for C++0x compatibility
-AC_LANG([C++])
-ORIGINAL_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -Werror -std=c++0x"
-
-AC_CACHE_CHECK(
- [whether C++ compiler supports variadic templates],
- [ac_cv_cpp_variadic_templates],
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include "variadic_templates_test.cpp"]])],
- [ac_cv_cpp_variadic_templates=yes],
- [ac_cv_cpp_variadic_templates=no]))
-
-#AC_CACHE_CHECK(
-# [whether C++ compiler supports nullptr],
-# [ac_cv_cpp_nullptr],
-# AC_COMPILE_IFELSE([AC_LANG_SOURCE([[static void* myptr = nullptr;]])],
-# [ac_cv_cpp_nullptr=yes],
-# [ac_cv_cpp_nullptr=no]))
-
-AS_IF(
- [test "x$ac_cv_cpp_variadic_templates" = "xyes" ],
- [],
- [AC_MSG_ERROR([at least one required C++ compiler feature is not supported])])
-
-CPPFLAGS="$ORIGINAL_CPPFLAGS"
-
-# environment
-AC_ARG_VAR([NO_VERSIONED_INCLUDE_DIR], [set this to 1 in order to install headers into /cppa/ rather than into /cppa//cppa/])
-AM_CONDITIONAL([VERSIONED_INCLUDE_DIR], [test "x$NO_VERSIONED_INCLUDE_DIR" != "x1"])
-
-AC_CONFIG_FILES([Makefile unit_testing/Makefile examples/Makefile benchmarks/Makefile libcppa.pc])
-AC_OUTPUT
diff --git a/cppa.files b/cppa.files
index 5a794f2ef6..1b95e7359d 100644
--- a/cppa.files
+++ b/cppa.files
@@ -1,267 +1,265 @@
-cppa/ref_counted.hpp
-cppa/cow_tuple.hpp
-unit_testing/main.cpp
-cppa/util/void_type.hpp
-cppa/util/type_list.hpp
-cppa/util/conjunction.hpp
-cppa/util/disjunction.hpp
-unit_testing/test.hpp
-cppa/uniform_type_info.hpp
-src/uniform_type_info.cpp
+benchmarks/ActorCreation.scala
+benchmarks/Distributed.scala
+benchmarks/MailboxPerformance.scala
+benchmarks/Matching.scala
+benchmarks/MixedCase.scala
+benchmarks/actor_creation.cpp
+benchmarks/actor_creation.erl
+benchmarks/distributed.cpp
+benchmarks/distributed.erl
+benchmarks/mailbox_performance.cpp
+benchmarks/mailbox_performance.erl
+benchmarks/matching.cpp
+benchmarks/matching.erl
+benchmarks/mixed_case.cpp
+benchmarks/mixed_case.erl
+benchmarks/theron_actor_creation.cpp
+benchmarks/theron_mailbox_performance.cpp
+benchmarks/theron_mixed_case.cpp
+benchmarks/utility.hpp
+cppa/detail/abstract_actor.hpp
+cppa/event_based_actor.hpp
+cppa/actor.hpp
+cppa/actor_proxy.hpp
+cppa/announce.hpp
+cppa/any_tuple.hpp
+cppa/anything.hpp
+cppa/atom.hpp
+cppa/attachable.hpp
+cppa/behavior.hpp
+cppa/binary_deserializer.hpp
+cppa/binary_serializer.hpp
+cppa/channel.hpp
cppa/config.hpp
-unit_testing/test__tuple.cpp
-cppa/detail/abstract_tuple.hpp
-cppa/detail/tuple_vals.hpp
-cppa/detail/decorated_tuple.hpp
cppa/cow_ptr.hpp
-cppa/detail/ref_counted_impl.hpp
-cppa/intrusive_ptr.hpp
-unit_testing/test__spawn.cpp
-src/mock_scheduler.cpp
-cppa/actor.hpp
-unit_testing/test__intrusive_ptr.cpp
-cppa/util/callable_trait.hpp
-unit_testing/test__type_list.cpp
-cppa/util/compare_tuples.hpp
-cppa/get.hpp
-cppa/detail/tdata.hpp
-cppa/detail/invokable.hpp
-cppa/on.hpp
-unit_testing/test__serialization.cpp
-cppa/serializer.hpp
+cppa/cow_tuple.hpp
+cppa/cppa.hpp
cppa/deserializer.hpp
-cppa/object.hpp
+cppa/detail/abstract_scheduled_actor.hpp
+cppa/detail/abstract_tuple.hpp
+cppa/detail/actor_count.hpp
+cppa/detail/actor_proxy_cache.hpp
+cppa/detail/actor_registry.hpp
+cppa/detail/addressed_message.hpp
+cppa/detail/atom_val.hpp
+cppa/detail/boxed.hpp
+cppa/detail/buffer.hpp
+cppa/detail/channel.hpp
+cppa/detail/container_tuple_view.hpp
+cppa/thread_mapped_actor.hpp
+cppa/detail/decorated_tuple.hpp
+cppa/detail/default_uniform_type_info_impl.hpp
+cppa/detail/demangle.hpp
+cppa/detail/disablable_delete.hpp
+cppa/detail/empty_tuple.hpp
+cppa/detail/filter_result.hpp
+cppa/detail/get_behavior.hpp
+cppa/detail/group_manager.hpp
+cppa/detail/implicit_conversions.hpp
+cppa/detail/list_member.hpp
+cppa/detail/mailman.hpp
+cppa/detail/map_member.hpp
+cppa/detail/matches.hpp
+cppa/detail/native_socket.hpp
+cppa/detail/network_manager.hpp
+cppa/detail/object_array.hpp
cppa/detail/object_impl.hpp
-cppa/detail/swap_bytes.hpp
-src/serializer.cpp
-src/deserializer.cpp
-cppa/util/is_legal_tuple_type.hpp
-cppa/util/replace_type.hpp
+cppa/detail/pair_member.hpp
+cppa/detail/post_office.hpp
+cppa/detail/primitive_member.hpp
+cppa/detail/projection.hpp
+cppa/detail/pseudo_tuple.hpp
+cppa/detail/ptype_to_type.hpp
+cppa/detail/receive_loop_helper.hpp
+cppa/detail/recursive_queue_node.hpp
+cppa/detail/ref_counted_impl.hpp
+cppa/detail/scheduled_actor_dummy.hpp
cppa/detail/serialize_tuple.hpp
-unit_testing/test__atom.cpp
+cppa/detail/singleton_manager.hpp
+cppa/detail/swap_bytes.hpp
+cppa/detail/tdata.hpp
+cppa/detail/thread_pool_scheduler.hpp
+cppa/detail/to_uniform_name.hpp
+cppa/detail/tuple_cast_impl.hpp
+cppa/detail/tuple_iterator.hpp
+cppa/detail/tuple_vals.hpp
+cppa/detail/tuple_view.hpp
+cppa/detail/type_to_ptype.hpp
+cppa/detail/types_array.hpp
+cppa/detail/unboxed.hpp
+cppa/detail/uniform_type_info_map.hpp
+cppa/detail/value_guard.hpp
+cppa/detail/yield_interface.hpp
+cppa/context_switching_actor.hpp
+cppa/either.hpp
+cppa/exception.hpp
+cppa/exit_reason.hpp
+cppa/from_string.hpp
+cppa/sb_actor.hpp
+cppa/get.hpp
+cppa/group.hpp
+cppa/guard_expr.hpp
+cppa/intrusive/forward_iterator.hpp
cppa/intrusive/single_reader_queue.hpp
-unit_testing/test__local_group.cpp
-cppa/detail/channel.hpp
+cppa/intrusive/singly_linked_list.hpp
+cppa/intrusive_ptr.hpp
cppa/local_actor.hpp
-cppa/channel.hpp
-src/channel.cpp
+cppa/match.hpp
+cppa/match_expr.hpp
+cppa/object.hpp
+cppa/on.hpp
+cppa/option.hpp
+cppa/partial_function.hpp
+cppa/pattern.hpp
+cppa/primitive_type.hpp
+cppa/primitive_variant.hpp
+cppa/process_information.hpp
+cppa/receive.hpp
+cppa/ref_counted.hpp
cppa/scheduled_actor.hpp
-cppa/cppa.hpp
-cppa/scheduling_hint.hpp
-src/scheduled_actor.cpp
-cppa/group.hpp
-src/group.cpp
-queue_performances/main.cpp
-queue_performances/sutter_list.hpp
-queue_performances/defines.hpp
-queue_performances/cached_stack.hpp
-queue_performances/blocking_cached_stack.hpp
-queue_performances/blocking_cached_stack2.hpp
-queue_performances/blocking_sutter_list.hpp
-queue_performances/lockfree_list.hpp
-queue_performances/intrusive_sutter_list.hpp
-src/local_actor.cpp
cppa/scheduler.hpp
-cppa/detail/mock_scheduler.hpp
-src/scheduler.cpp
-cppa/detail/converted_thread_context.hpp
-src/converted_thread_context.cpp
-unit_testing/test__uniform_type.cpp
-cppa/detail/demangle.hpp
-src/demangle.cpp
-cppa/detail/to_uniform_name.hpp
-src/to_uniform_name.cpp
-cppa/detail/default_uniform_type_info_impl.hpp
-src/object.cpp
-cppa/util/comparable.hpp
-cppa/primitive_variant.hpp
-cppa/primitive_type.hpp
-cppa/util/pt_token.hpp
-cppa/detail/type_to_ptype.hpp
-cppa/detail/ptype_to_type.hpp
-cppa/util/is_primitive.hpp
-cppa/util/is_iterable.hpp
-src/primitive_variant.cpp
-unit_testing/test__primitive_variant.cpp
-cppa/detail/primitive_member.hpp
-cppa/detail/list_member.hpp
-cppa/detail/pair_member.hpp
-cppa/detail/map_member.hpp
-cppa/util/is_forward_iterator.hpp
-cppa/util/rm_ref.hpp
-cppa/binary_serializer.hpp
-src/binary_serializer.cpp
-cppa/binary_deserializer.hpp
-src/binary_deserializer.cpp
-src/actor.cpp
-cppa/announce.hpp
-cppa/util/shared_spinlock.hpp
-src/shared_spinlock.cpp
-cppa/util/shared_lock_guard.hpp
-cppa/detail/object_array.hpp
-src/object_array.cpp
-cppa/any_tuple.hpp
-src/any_tuple.cpp
-cppa/util/abstract_uniform_type_info.hpp
-cppa/util/upgrade_lock_guard.hpp
+cppa/scheduling_hint.hpp
+cppa/self.hpp
+cppa/serializer.hpp
cppa/to_string.hpp
-src/string_serialization.cpp
-cppa/from_string.hpp
+cppa/tpartial_function.hpp
+cppa/tuple_cast.hpp
+cppa/uniform_type_info.hpp
+cppa/util/abstract_uniform_type_info.hpp
+cppa/util/apply_args.hpp
+cppa/util/apply_tuple.hpp
+cppa/util/arg_match_t.hpp
cppa/util/at.hpp
+cppa/util/callable_trait.hpp
+cppa/util/comparable.hpp
+cppa/util/compare_tuples.hpp
+cppa/util/conjunction.hpp
+cppa/util/deduce_ref_type.hpp
+cppa/util/disjunction.hpp
+cppa/util/duration.hpp
cppa/util/element_at.hpp
+cppa/util/fiber.hpp
+cppa/util/fixed_vector.hpp
cppa/util/if_else.hpp
+cppa/util/is_array_of.hpp
+cppa/util/is_builtin.hpp
+cppa/util/is_comparable.hpp
+cppa/util/is_forward_iterator.hpp
+cppa/util/is_iterable.hpp
+cppa/util/is_legal_tuple_type.hpp
+cppa/util/is_manipulator.hpp
+cppa/util/is_mutable_ref.hpp
+cppa/util/is_primitive.hpp
+cppa/util/left_or_right.hpp
+cppa/util/producer_consumer_list.hpp
cppa/util/pt_dispatch.hpp
-cppa/detail/get_behavior.hpp
-unit_testing/test__ripemd_160.cpp
-cppa/process_information.hpp
-src/process_information.cpp
+cppa/util/pt_token.hpp
+cppa/util/purge_refs.hpp
+cppa/util/replace_type.hpp
cppa/util/ripemd_160.hpp
-src/ripemd_160.cpp
-src/unicast_network.cpp
-unit_testing/test__remote_actor.cpp
-unit_testing/ping_pong.hpp
-unit_testing/ping_pong.cpp
-cppa/exception.hpp
-src/exception.cpp
-cppa/actor_proxy.hpp
-src/actor_proxy.cpp
-cppa/detail/actor_proxy_cache.hpp
-src/actor_proxy_cache.cpp
-src/attachable.cpp
-cppa/attachable.hpp
-cppa/atom.hpp
-cppa/detail/atom_val.hpp
-src/atom.cpp
-src/cppa.cpp
-cppa/exit_reason.hpp
-cppa/abstract_actor.hpp
-cppa/detail/mailman.hpp
-src/mailman.cpp
-cppa/detail/native_socket.hpp
-src/native_socket.cpp
-cppa/detail/post_office.hpp
-src/post_office.cpp
-cppa/detail/buffer.hpp
-cppa/detail/actor_count.hpp
-src/actor_count.cpp
-cppa/util/fiber.hpp
-src/fiber.cpp
-cppa/detail/yield_interface.hpp
-src/yield_interface.cpp
-cppa/detail/abstract_scheduled_actor.hpp
-src/abstract_scheduled_actor.cpp
-src/invokable.cpp
-cppa/detail/thread_pool_scheduler.hpp
-src/thread_pool_scheduler.cpp
-cppa/detail/receive_loop_helper.hpp
+cppa/util/rm_option.hpp
+cppa/util/rm_ref.hpp
+cppa/util/shared_lock_guard.hpp
+cppa/util/shared_spinlock.hpp
+cppa/util/static_foreach.hpp
+cppa/util/tbind.hpp
+cppa/util/type_list.hpp
+cppa/util/type_pair.hpp
+cppa/util/upgrade_lock_guard.hpp
+cppa/util/void_type.hpp
cppa/util/wrapped.hpp
-cppa/detail/boxed.hpp
-cppa/detail/unboxed.hpp
-src/abstract_tuple.cpp
-cppa/util/duration.hpp
-src/duration.cpp
-cppa/receive.hpp
-cppa/detail/thread.hpp
-cppa/detail/singleton_manager.hpp
-src/singleton_manager.cpp
-cppa/detail/actor_registry.hpp
-src/actor_registry.cpp
-cppa/detail/uniform_type_info_map.hpp
-cppa/detail/network_manager.hpp
-src/network_manager.cpp
-cppa/detail/post_office_msg.hpp
-src/post_office_msg.cpp
-cppa/detail/group_manager.hpp
-src/group_manager.cpp
-cppa/detail/empty_tuple.hpp
-src/empty_tuple.cpp
-cppa/detail/addressed_message.hpp
-src/addressed_message.cpp
-unit_testing/test__yield_interface.cpp
-cppa/anything.hpp
-cppa/pattern.hpp
-unit_testing/test__pattern.cpp
-cppa/util/fixed_vector.hpp
-cppa/detail/implicit_conversions.hpp
-cppa/util/is_array_of.hpp
examples/announce_example_1.cpp
examples/announce_example_2.cpp
examples/announce_example_3.cpp
examples/announce_example_4.cpp
examples/announce_example_5.cpp
+examples/dancing_kirby.cpp
+examples/dining_philosophers.cpp
examples/hello_world_example.cpp
examples/math_actor_example.cpp
-cppa/detail/yielding_actor.hpp
-src/yielding_actor.cpp
-cppa/either.hpp
-cppa/abstract_event_based_actor.hpp
-src/abstract_event_based_actor.cpp
-cppa/event_based_actor.hpp
+queue_performances/blocking_cached_stack.hpp
+queue_performances/blocking_cached_stack2.hpp
+queue_performances/blocking_sutter_list.hpp
+queue_performances/cached_stack.hpp
+queue_performances/defines.hpp
+queue_performances/intrusive_sutter_list.hpp
+queue_performances/lockfree_list.hpp
+queue_performances/main.cpp
+queue_performances/sutter_list.hpp
src/event_based_actor.cpp
-cppa/stacked_event_based_actor.hpp
-src/stacked_event_based_actor.cpp
-cppa/event_based_actor_base.hpp
-cppa/fsm_actor.hpp
-cppa/self.hpp
-src/self.cpp
-cppa/behavior.hpp
+src/abstract_tuple.cpp
+src/actor.cpp
+src/actor_count.cpp
+src/actor_proxy.cpp
+src/actor_proxy_cache.cpp
+src/actor_registry.cpp
+src/addressed_message.cpp
+src/any_tuple.cpp
+src/atom.cpp
+src/attachable.cpp
+src/binary_deserializer.cpp
+src/binary_serializer.cpp
+src/channel.cpp
+src/thread_mapped_actor.cpp
+src/demangle.cpp
+src/deserializer.cpp
+src/duration.cpp
+src/empty_tuple.cpp
+src/exception.cpp
+src/fiber.cpp
+src/group.cpp
+src/group_manager.cpp
+src/local_actor.cpp
+src/mailman.cpp
+src/native_socket.cpp
+src/network_manager.cpp
+src/object.cpp
+src/object_array.cpp
+src/partial_function.cpp
+src/pattern.cpp
+src/post_office.cpp
+src/primitive_variant.cpp
+src/process_information.cpp
src/receive.cpp
-benchmarks/actor_creation.cpp
-benchmarks/mailbox_performance.cpp
-benchmarks/mixed_case.cpp
-benchmarks/actor_creation.erl
-benchmarks/mailbox_performance.erl
-benchmarks/mixed_case.erl
-benchmarks/ActorCreation.scala
-benchmarks/MailboxPerformance.scala
-benchmarks/MixedCase.scala
-cppa/util/producer_consumer_list.hpp
-cppa/util/arg_match_t.hpp
-cppa/detail/types_array.hpp
-cppa/util/is_builtin.hpp
-cppa/util/type_pair.hpp
-cppa/util/tbind.hpp
-cppa/option.hpp
-cppa/tuple_cast.hpp
-cppa/util/is_mutable_ref.hpp
-cppa/util/is_manipulator.hpp
-cppa/util/apply_tuple.hpp
-benchmarks/Matching.scala
-benchmarks/matching.cpp
-benchmarks/matching.erl
-benchmarks/theron_mailbox_performance.cpp
-benchmarks/utility.hpp
-benchmarks/theron_actor_creation.cpp
-benchmarks/theron_mixed_case.cpp
-cppa/util/static_foreach.hpp
-cppa/type_value_pair.hpp
-examples/dining_philosophers.cpp
-cppa/detail/disablable_delete.hpp
+src/ripemd_160.cpp
+src/scheduled_actor.cpp
+src/scheduled_actor_dummy.cpp
+src/scheduler.cpp
+src/self.cpp
+src/serializer.cpp
+src/shared_spinlock.cpp
+src/singleton_manager.cpp
+src/string_serialization.cpp
+src/thread_pool_scheduler.cpp
+src/to_uniform_name.cpp
+src/unicast_network.cpp
+src/uniform_type_info.cpp
+src/yield_interface.cpp
+src/context_switching_actor.cpp
+unit_testing/main.cpp
+unit_testing/ping_pong.cpp
+unit_testing/ping_pong.hpp
+unit_testing/test.hpp
+unit_testing/test__atom.cpp
unit_testing/test__fixed_vector.cpp
-cppa/detail/tuple_cast_impl.hpp
-cppa/match.hpp
-cppa/partial_function.hpp
-src/partial_function.cpp
-cppa/intrusive/singly_linked_list.hpp
-cppa/intrusive/forward_iterator.hpp
unit_testing/test__intrusive_containers.cpp
-examples/dancing_kirby.cpp
-cppa/util/is_comparable.hpp
-cppa/detail/tuple_view.hpp
-cppa/detail/container_tuple_view.hpp
-cppa/detail/matches.hpp
+unit_testing/test__intrusive_ptr.cpp
+unit_testing/test__local_group.cpp
unit_testing/test__match.cpp
-cppa/guard_expr.hpp
-src/pattern.cpp
-cppa/util/left_or_right.hpp
-cppa/util/apply_args.hpp
-cppa/tpartial_function.hpp
-cppa/util/rm_option.hpp
-cppa/util/projection.hpp
-cppa/util/purge_refs.hpp
-cppa/util/deduce_ref_type.hpp
-cppa/detail/projection.hpp
-cppa/detail/value_guard.hpp
-cppa/detail/tuple_iterator.hpp
-cppa/match_expr.hpp
-cppa/detail/pseudo_tuple.hpp
+unit_testing/test__pattern.cpp
+unit_testing/test__primitive_variant.cpp
+unit_testing/test__remote_actor.cpp
+unit_testing/test__ripemd_160.cpp
+unit_testing/test__serialization.cpp
+unit_testing/test__spawn.cpp
+unit_testing/test__tuple.cpp
+unit_testing/test__type_list.cpp
+unit_testing/test__uniform_type.cpp
+unit_testing/test__yield_interface.cpp
+cppa/detail/receive_policy.hpp
+cppa/detail/behavior_stack.hpp
+src/behavior_stack.cpp
+cppa/detail/stacked_actor_mixin.hpp
+cppa/detail/event_based_actor_factory.hpp
+cppa/factory.hpp
+src/factory.cpp
diff --git a/cppa.includes b/cppa.includes
index 3f7cd052d7..6e6b737a91 100644
--- a/cppa.includes
+++ b/cppa.includes
@@ -1,6 +1,5 @@
-/Users/neverlord/libcppa
-/home/neverlord/libcppa
+.
+./unit_testing
+./third_party/boost_context/include/
/opt/local/include/gcc46/c++
/opt/local/include/
-/Users/neverlord/libcppa/unit_testing
-/home/neverlord/libcppa/unit_testing
diff --git a/cppa/abstract_event_based_actor.hpp b/cppa/abstract_event_based_actor.hpp
deleted file mode 100644
index b6cdc8e652..0000000000
--- a/cppa/abstract_event_based_actor.hpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/******************************************************************************\
- * ___ __ *
- * /\_ \ __/\ \ *
- * \//\ \ /\_\ \ \____ ___ _____ _____ __ *
- * \ \ \ \/\ \ \ '__`\ /'___\/\ '__`\/\ '__`\ /'__`\ *
- * \_\ \_\ \ \ \ \L\ \/\ \__/\ \ \L\ \ \ \L\ \/\ \L\.\_ *
- * /\____\\ \_\ \_,__/\ \____\\ \ ,__/\ \ ,__/\ \__/.\_\ *
- * \/____/ \/_/\/___/ \/____/ \ \ \/ \ \ \/ \/__/\/_/ *
- * \ \_\ \ \_\ *
- * \/_/ \/_/ *
- * *
- * Copyright (C) 2011, 2012 *
- * Dominik Charousset *
- * *
- * This file is part of libcppa. *
- * libcppa is free software: you can redistribute it and/or modify it under *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License *
- * or (at your option) any later version. *
- * *
- * libcppa is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
- * See the GNU Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public License *
- * along with libcppa. If not, see . *
-\******************************************************************************/
-
-
-#ifndef EVENT_DRIVEN_ACTOR_HPP
-#define EVENT_DRIVEN_ACTOR_HPP
-
-#include
-#include
-#include
-
-#include "cppa/config.hpp"
-#include "cppa/either.hpp"
-#include "cppa/pattern.hpp"
-#include "cppa/behavior.hpp"
-#include "cppa/detail/disablable_delete.hpp"
-#include "cppa/detail/abstract_scheduled_actor.hpp"
-
-namespace cppa {
-
-/**
- * @brief Base class for all event-based actor implementations.
- */
-class abstract_event_based_actor : public detail::abstract_scheduled_actor
-{
-
- typedef detail::abstract_scheduled_actor super;
- typedef super::queue_node queue_node;
-
- public:
-
- void dequeue(behavior&); //override
-
- void dequeue(partial_function&); //override
-
- void resume(util::fiber*, resume_callback* callback); //override
-
- /**
- * @brief Initializes the actor by defining an initial behavior.
- */
- virtual void init() = 0;
-
- /**
- * @copydoc cppa::scheduled_actor::on_exit()
- */
- virtual void on_exit();
-
- inline abstract_event_based_actor* attach_to_scheduler(scheduler* sched)
- {
- CPPA_REQUIRE(sched != nullptr);
- m_scheduler = sched;
- init();
- return this;
- }
-
- protected:
-
- abstract_event_based_actor();
-
- // ownership flag + pointer
- typedef std::unique_ptr>
- stack_element;
-
- std::vector m_loop_stack;
-
- // current position in mailbox
- mailbox_cache_type::iterator m_mailbox_pos;
-
- // provoke compiler errors for usage of receive() and related functions
-
- /**
- * @brief Provokes a compiler error to ensure that an event-based actor
- * does not accidently uses receive() instead of become().
- */
- template
- void receive(Args&&...)
- {
- static_assert((sizeof...(Args) + 1) < 1,
- "You shall not use receive in an event-based actor. "
- "Use become() instead.");
- }
-
- /**
- * @brief Provokes a compiler error.
- */
- template
- void receive_loop(Args&&... args)
- {
- receive(std::forward(args)...);
- }
-
- /**
- * @brief Provokes a compiler error.
- */
- template
- void receive_while(Args&&... args)
- {
- receive(std::forward(args)...);
- }
-
- /**
- * @brief Provokes a compiler error.
- */
- template
- void do_receive(Args&&... args)
- {
- receive(std::forward(args)...);
- }
-
- private:
-
- bool handle_message(queue_node& iter);
- bool invoke_from_cache();
-
-};
-
-} // namespace cppa
-
-#endif // EVENT_DRIVEN_ACTOR_HPP
diff --git a/cppa/actor.hpp b/cppa/actor.hpp
index 26730737d4..9cd6ae8f4e 100644
--- a/cppa/actor.hpp
+++ b/cppa/actor.hpp
@@ -28,8 +28,8 @@
\******************************************************************************/
-#ifndef ACTOR_HPP
-#define ACTOR_HPP
+#ifndef CPPA_ACTOR_HPP
+#define CPPA_ACTOR_HPP
#include
#include
@@ -47,17 +47,27 @@ namespace cppa {
class serializer;
class deserializer;
+class actor;
+
+/**
+ * @brief A unique actor ID.
+ * @relates actor
+ */
typedef std::uint32_t actor_id;
/**
* @brief Base class for all actor implementations.
*/
-class actor : public channel
-{
+class actor : public channel {
public:
- ~actor();
+ /**
+ * @brief Enqueues @p msg to the actor's mailbox and returns true if
+ * this actor is an scheduled actor that successfully changed
+ * its state to @p pending.
+ */
+ virtual bool chained_enqueue(actor* sender, any_tuple msg);
/**
* @brief Attaches @p ptr to this actor.
@@ -97,22 +107,6 @@ class actor : public channel
std::is_base_of::value
>::type* = 0);
- /**
- * @brief Forces this actor to subscribe to the group @p what.
- *
- * The group will be unsubscribed if the actor finishes execution.
- * @param what Group instance that should be joined.
- */
- void join(group_ptr& what);
-
- /**
- * @brief Forces this actor to leave the group @p what.
- * @param what Joined group that should be leaved.
- * @note Groups are leaved automatically if the Actor finishes
- * execution.
- */
- void leave(const group_ptr& what);
-
/**
* @brief Links this actor to @p other.
* @param other Actor instance that whose execution is coupled to the
@@ -150,7 +144,7 @@ class actor : public channel
void link_to(intrusive_ptr&& other);
/**
- * @copydoc unlink_from(intrusive_ptr&)
+ * @copydoc :unlink_from(intrusive_ptr&)
*/
void unlink_from(intrusive_ptr&& other);
@@ -210,6 +204,7 @@ class actor : public channel
/**
* @brief A smart pointer type that manages instances of {@link actor}.
+ * @relates actor
*/
typedef intrusive_ptr actor_ptr;
@@ -217,23 +212,19 @@ typedef intrusive_ptr actor_ptr;
* inline and template member function implementations *
******************************************************************************/
-inline const process_information& actor::parent_process() const
-{
+inline const process_information& actor::parent_process() const {
return *m_parent_process;
}
-inline process_information_ptr actor::parent_process_ptr() const
-{
+inline process_information_ptr actor::parent_process_ptr() const {
return m_parent_process;
}
-inline std::uint32_t actor::id() const
-{
+inline std::uint32_t actor::id() const {
return m_id;
}
-inline bool actor::is_proxy() const
-{
+inline bool actor::is_proxy() const {
return m_is_proxy;
}
@@ -241,43 +232,37 @@ template
bool actor::attach(std::unique_ptr&& ptr,
typename std::enable_if<
std::is_base_of::value
- >::type*)
-{
+ >::type*) {
return attach(static_cast(ptr.release()));
}
template
-class functor_attachable : public attachable
-{
+class functor_attachable : public attachable {
F m_functor;
public:
template
- functor_attachable(FArg&& arg) : m_functor(std::forward(arg))
- {
+ functor_attachable(FArg&& arg) : m_functor(std::forward(arg)) {
}
- void actor_exited(std::uint32_t reason)
- {
+ void actor_exited(std::uint32_t reason) {
m_functor(reason);
}
- bool matches(const attachable::token&)
- {
+ bool matches(const attachable::token&) {
return false;
}
};
template
-bool actor::attach_functor(F&& ftor)
-{
+bool actor::attach_functor(F&& ftor) {
typedef typename util::rm_ref::type f_type;
return attach(new functor_attachable(std::forward(ftor)));
}
} // namespace cppa
-#endif // ACTOR_HPP
+#endif // CPPA_ACTOR_HPP
diff --git a/cppa/actor_proxy.hpp b/cppa/actor_proxy.hpp
index f58146e28d..481d629dd5 100644
--- a/cppa/actor_proxy.hpp
+++ b/cppa/actor_proxy.hpp
@@ -28,25 +28,24 @@
\******************************************************************************/
-#ifndef ACTOR_PROXY_HPP
-#define ACTOR_PROXY_HPP
+#ifndef CPPA_ACTOR_PROXY_HPP
+#define CPPA_ACTOR_PROXY_HPP
#include "cppa/actor.hpp"
-#include "cppa/abstract_actor.hpp"
+#include "cppa/detail/abstract_actor.hpp"
namespace cppa {
#ifdef CPPA_DOCUMENTATION
/**
- * @brief Represents a remote Actor.
+ * @brief Represents a remote actor.
*/
class actor_proxy : public actor { };
#else // CPPA_DOCUMENTATION
-class actor_proxy : public abstract_actor
-{
+class actor_proxy : public detail::abstract_actor {
typedef abstract_actor super;
@@ -54,19 +53,17 @@ class actor_proxy : public abstract_actor
actor_proxy(std::uint32_t mid, const process_information_ptr& parent);
- void enqueue(actor* sender, any_tuple&& msg);
-
- void enqueue(actor* sender, const any_tuple& msg);
+ void enqueue(actor* sender, any_tuple msg);
void link_to(intrusive_ptr& other);
- // do not cause to send this actor an ":Unlink" message
+ // do not cause to send this actor an "UNLINK" message
// to the "original" remote actor
void local_link_to(intrusive_ptr& other);
void unlink_from(intrusive_ptr& other);
- // do not cause to send this actor an ":Unlink" message
+ // do not cause to send this actor an "UNLINK" message
// to the "original" remote actor
void local_unlink_from(intrusive_ptr& other);
@@ -76,15 +73,18 @@ class actor_proxy : public abstract_actor