Wednesday, September 24, 2014

Version 0.11 released!

Version 0.11 of CAF has just been released. The core components mainly received optimizations and bugfixes this time around. However, CAF now includes the first alpha versions of a runtime inspection & debugging toolkit. Read more on GitHub.

Wednesday, July 23, 2014

Version 0.10 released!

Version 0.10 of CAF: C++ Actor Framework has just been released. Wait, what? For those of you that aren't subscribed to the mailing list, here is the Mail I've posted earlier this day:

libcppa started in 2011 and it has been in constant development ever since. I think we can call this a success on its own and we see more and more applications using libcppa. We will announce the most exciting partners on our website soon, by the way.

To be quite frank, I did not expect the library to evolve that fast and with the recent additions to our team, I think it is a safe bet to say that the development will not slow down in the future. We are working on scaling the library down for embedded HW platforms and we are working on tools that make debugging and fine-tuning your applications easier. The project is about to become something bigger than "just" an actor library. Hence, we have decided to revamp libcppa and call the project:

CAF: C++ Actor Framework

We will move the GitHub repository to and restructure it. This mailing list will be renamed to and we will launch a new website. We have synchronized the release of the new repository with the release of version 0.10 of *libcaf*. The library has been modularized and you'll find libcaf_core and libcaf_io in the initial release of CAF. You can use libcaf_core if all you need is the concurrency abstraction of the library. The networking parts have been moved to libcaf_io. You will find "remote_actor" and "publish" there. The OpenCL part will be available as submodule soon. We go into more detail in a blog post covering the changes and you will find a migration guide in the manual.

Version 0.10, the new GitHub URL, and the new Google Group Name will go live *today*. 0.10 will have breaking changes. We tried to make migration less painful by still shipping the old cppa/cppa.hpp header, but there are breaking changes nonetheless. I am sorry that we break existing code again: twice in a row to be correct (0.9 had breaking changes, too). On the other hand, I think it really is worth it and we could get rid of some legacy code and inconsistencies that we don not want to maintain in the long run.

We sincerely hope that we can get a smooth transition. You *should* be forwarded to the repository URL automatically and still have it starred/watched/forked. The mailing list *should* keep you as member. However, please feel free to drop me a mail if something isn't working for you.

So, here it is, the first official release under the new name CAF. Once you've checked out the new release, you'll probably notice that things have changed quite a bit. The first thing you should do is to open the manual under manual/manual.pdf and scroll right to the end. You will find a migration guide from 0.9 to 0.10 on the last two pages.

To use the library, you can use the new CMake script under cmake/FindLibcaf.cmake. Usually, you want to have the two components "core" and "io": find_package(Libcaf COMPONENTS core io REQUIRED). These two libraries offer you the functionality you're used to from libcppa. Please note that the OpenCL component is not ready quite yet. Upon success, the script will set the two variables ${LIBCAF_LIBRARIES} and ${LIBCAF_INCLUDE_DIRS}.

By the way, CAF is released under both the BSD 3-Clause and the Boost License. You can use it under the terms of either of those licenses (your choice!).

From now on, you can visit us at:
... or go to our new project website:

As always, please don't hesitate to get in touch if you have any question.

Friday, May 30, 2014

Version 0.9.3 released ... under the Boost Software License!

Version 0.9.3 of libcppa has just been released. The biggest change this time around is the switch from LGPL to the Boost Software License 1.0. If you are working in one of those companies that prohibit LGPL-licensed code, you are finally able to use actors in your day-to-day programming.

Due to the everlasting problems with the Boost.Context-based context-switching actor implementation, this features is now turned off by default. To re-enable it, use the --enable-context-switching option of the configure script. Since this feature is of limited use anyways, we consider removing it completely in a future version. We don't think it is worth the maintenance effort in the long run.

Tuesday, May 6, 2014

Issues with Boost on Ubuntu

As reported by users of libcppa, the library fails to compile - or rather: to link - on the latest Ubuntu release with Boost. To get a running version of libcppa, please configure it using ./configure --standalone-build. This will disable the context-switching feature of libcppa. Context-switching is only relevant in case you want to have cooperative scheduling of blocking actors. When disabling this feature, all blocking actors are implicitly detached.

Since Boost only enables context-switching, we are considering to turn this feature into an opt-in rather than an opt-out at compile time. In case your system is lacking Boost, you won't get the context-switching actors anyways (and will not be affected by this error). Other parts of the library do not depend on Boost, so there is no degradation of performance or functionality.

If you run into a similar error on a different Linux distribution, please let me know.

Monday, May 5, 2014

Version 0.9 released!

Version 0.9 of libcppa has just been released. It features an all-new work-stealing scheduler. Expect new benchmark results in the near future as the last evaluation is heavily outdated by now.

Aside from performance performance tweaks, version 0.9 also features an improved broker interface covered in a new manual section as well as a new example.

Friday, February 21, 2014

Prerelease of Version 0.9

Version 0.9 of libcppa is just around the corner – and it's not simply an incremental update but a redesign of many (in fact: most) parts of libcppa. Since we don't plan to make any more changes to the API, we've decided to do a prerelease. This gives us the opportunity to get feedback from the community while polishing the remaining parts of the library and it also gives you the opportunity to start porting your code to 0.9 early.

The most important changes:
  • self has been removed
    This is the biggest change and in fact did cause a lot of redesign and implementation work. The major problem with this keyword-like identifier is that it must have a single type, because it's implemented as a thread-local variable. Since there are so many different kinds of actors (event-based or blocking, untyped or typed), self simply isn't useful anymore. It could only point to the address (see below) of an actor, but this isn't useful at all, because we cannot get the type information we need. Instead of a thread-local pointer, you can now use the first argument in functor-based actors to "catch" the self pointer – with proper type information.
  • actor_ptr has been removed/replaced
    The name actor_ptr bothered me for long time now, because it's misleading. The fact that libcppa uses pointers behind the scenes to keep things fast should not be exposed in the API. However, that was not the reason for the change. libcppa now distinguishes between handles to actors, i.e., typed_actor<...> or actor, and addresses of actors, i.e., actor_addr. The reason for this change is that each actor has a logical, (network-wide) unique address, which is used by the networking layer of libcppa. Furthermore, for monitoring or linking, the address is all you need. However, the address is not sufficient for sending messages, because it doesn't have any type information. The function last_sender() now returns the address of the sender, meaning that send(last_sender(), ...) will cause a compiler error.
  • The API for typed actors is now similar to the API for untyped actors
    Although there are some minor differences (typed actors cannot use guard expressions for instance), the APIs are quite similar. You can use function-based or class-based actors, you can "catch" the self pointer in the same way, and you can change the behavior by calling become(...).

Issues (or: why this isn't a final release yet):
  • No scheduling
    The prerelease does not include a scheduler. Instead, each actor is always mapped to a thread, whether or not you use the detach flag. So... don't expect good performance when running many actors.
  • Documentation incomplete
    The manual has been revised, but doesn't include all new features. The same is true for the Doxygen-generated documentation.
  • Testing
    The unit tests of libcppa cover most of the new features, but there's still work to do.

As always, please don't hesitate to get in touch if you've found a bug, miss a feature, couldn't find something in the documentation, or simply have a question.

Saturday, November 9, 2013

Moving Forward: Type Safety & Actors

Type safety is a topic that comes up very frequently when talking to C++ developers about libcppa - and actors in general. Indeed, the major concern about libcppa at the C++Now 2013 conference was that it does not provide a type-safe messaging interface. I'm not going to discuss pros and cons of dynamic and static typing. Both approaches do have their benefits. In libcppa, you can use atoms to "create" new message types on the fly and then pattern match on the receiver side. In this way, it is very lightweight to introduce new message types to a system, as you don't have to maintain header files for your message types. On the flip side, "wrong" message types are detected at runtime. When sending arguments in the wrong order, your pattern on the receiver side will not match. Naturally, most C++ developers expect the compiler to detect those kind of bugs.

Version 0.8 introduced strongly-typed actors to give developers a choice. Unfortunately, libcppa is now a two-class society. Even worse, it is indeed rather easy to get an untyped reference to a strongly-typed actor. But let's step back and take a look at the issues individually.
  1. Second-class Typed Actors: Typed actors are not allowed to use guard expressions. This in itself is not a problem. The problem is how libcppa signals system events. For example, when monitoring an actor, you'll receive a "down" message consisting of the atom 'DOWN' and the exit reason as uint32. Since typed actors are not allowed to use guards, the only thing they could possibly do is to define a handler for all messages with an atom as first element followed by an uint32. There are 1064 possible atoms. As a consequence, libcppa needs to introduce message types for system messages. This will break code and I would prefer not to, but it's better to break some code that's easy to repair than to have a broken design.
  2. Separated APIs: To spawn a typed actor, we use functions that return the behavior. For untyped actors, we can use void functions that call 'become' internally. Even worse, 'become' now can throw - when called from a typed actor. It's probably for the best to move 'become' from the namespace cppa to the class event_based_actor and always use function that return a behavior.
  3. Type-safety Not Enforced: As you might know if you've ever used libcppa: An actor can get a handle to itself by using 'self' and a handle to any actor that sent a message to it by calling 'self->last_sender()'. This handle is of course untyped. So, not only can a typed actor get an untyped handle to itself, each actor it is communicating with has an untyped handle to it. The only way to enforce type safety is to either remove 'self' completely from the API or to change its type to something not convertible to actor_ptr, so that you can only access member functions like 'trap_exits'. The member function 'last_sender()' then also would have to go or to return only a logical address that you can use for monitoring and linking, but not for message passing.
  4. Missing Features: This is not a design issue, but libcppa 0.9 will of course implement proper remote communication for typed actors.
libcppa started as a DSL for Erlang-style actor programming in C++. With version 0.9, libcppa will (hopefully) evolve into a unique actor system that supports untyped and typed actors side by side. Stay tuned. :)