FAQ page

06/08/10

I've added an FAQ page, linked from the documentation menu on the website.

http://theron.ashtonmason.net/index.php?t=page&p=documentation

It's pretty basic so far with answers to only a few questions. If you have any questions you'd like addressed let me know.

Version 2.05.01 released

15/07/10

This patch release fixes a couple of important build issues. Most significantly, the debug builds of the Boost thread libraries were previously used for release builds, when built via the included makefile. Visual Studio builds were unaffected.

As an incidental change, the makefile now assumes the use of GCC 4.4 rather than 3.4. That came about because I've been experimenting with Qt, and Qt Creator provides GCC 4.4 as part of its distribution. Turns out it's vital to build all libraries with the same release - or at least libraries built with 3.4 and 4.4 seem to be incompatible. The pre-built libraries included with Theron are now also built using GCC 4.4.

If you're using GCC 3.4 yourself then just switch the Boost library names back to "mgw34" in the makefile.

The general advice is to build Boost with your favourite build configuration, build Theron the same way, and update the included makefile to point at your Boost libraries correctly (the names reflect how they were built). See the release notes for more information.

More performance results

05/07/10

Published today, some performance results for Theron running on a "proper" machine, specifically a four-core Intel Xenon X5550 2.67GHz.

http://theron.ashtonmason.net/index.php?t=page&p=performance

Like the earlier results, these are timing measurements for the ThreadRing benchmark included in Theron-2.05.00. They confirm that Theron is fast. A "token" message is passed around a ring of 503 actors, with each actor forwarding the message to the next in the ring. The time for 50 million actor-to-actor "hops" is around 8 seconds, which compares with the times for the same benchmark in Erlang.

A few caveats apply, of course. For one, Theron implements a considerably stripped-down version of the Actor Model and doesn't offer the full functionality of Erlang. It also isn't a language and so brings with it the hazards of C++ -- you can shoot yourself in the foot, basically. But for those that want the convenience of the Actor Model in a C++ environment, Theron provides the raw performance.

Another thing to note is that Theron is effectively running on a single thread in the ThreadRing benchmark, due to the use of tail-call optimization. The process of sending a message from one actor to another around a ring is essentially a serial operation with no opportunity for significant parallelism. Therefore the smart way to do it is using a single thread which "executes" each actor in turn. That's what Theron does, in this case. You can specify more worker threads, but the results are the same since the additional threads offer no advantage, in this very specialized case, and so just spend the whole benchmark asleep.

In that sense ThreadRing is quite limited, as a test of parallelism. It's a test of message passing overheads, from Theron's point of the view. The key to running it fast is to make the queueing of messages and the dispatch of "dirty" actors to the worker threads as cheap as possible. The results suggest Theron's implementation is pretty efficient.

A useful next step would be to write a benchmark which shows true parallelism, and how it can be exploited easily and to good effect in Theron.

Performance results

03/07/10

I've already blogged about this in the blurb about the 2.05.00 release, but I thought I'd highlight that there are now some performance results for Theron online.

http://theron.ashtonmason.net/index.php?t=page&p=performance

Although tested on a somewhat humble machine, the results establish Theron's raw performance as being as good as (or better than) well-known Actor Model implementations such as Erlang and ActorFoundry.

(That said, it should be noted that those implementations are more fully-featured; Theron is quite lightweight by comparison and pretty "C++" in its design intentions).

More results, from a more representative four-core machine, to come in the near future.

Version 2.05.00 released

03/07/10

Version 2.05.00 is a minor release aimed at establishing some performance benchmarks.

The 'TokenRing' demo included in earlier releases has been renamed to 'ThreadRing', and rewritten to correctly implement the well-known thread-ring benchmark used for performance comparison of concurrent systems. The demo now matches the benchmark's traditional definition:

- create 503 linked threads (named 1 to 503)
- thread 503 should be linked to thread 1, forming an unbroken ring
- pass a token to thread 1
- pass the token from thread to thread N times
- print the name of the last thread (1 to 503) to take the token

Performance results for the new 'ThreadRing' benchmark are listed here:

http://theron.ashtonmason.net/index.php?t=page&p=performance

You can download the 2.05.00 release and read the release notes in full at this link:

http://theron.ashtonmason.net/index.php?t=downloads

Version 2.04.00 released

30/06/10

Version 2.04.00 of Theron is now available.

This release brings two important bugfixes and several significant optimizations. The TokenRing message processing speed benchmark is now faster by a factor of around two (ie. around a 50% reduction in execution times).

Hit the downloads page to grab a copy.

Version 2.03.00 released

27/06/10

Version 2.03.00 of Theron is now available for download. Another performance and benchmarking release, 2.03.00 sees another successive 40% improvement in raw message processing speed (as shown by the execution times of the TokenRing benchmark).

The release adds a couple of new benchmarks/demos, plus improvements to the metrics feature useful in profiling.

Of the new demos and benchmarks, Stack is aimed at stress-testing the message processing architecture of the Theron 2.0 framework. Executing a large number of push and pop operations on a single shared stack actor in parallel, the demo stresses the thread-safety and synchronization of the underlying code, and gives reason to think that the current implementation is pretty robust.

Under the hood, a bunch of work has been done to reduce the allocation overhead of message passing. Used message buffers are now cached in a succession of free lists and pools. Each actor now contains a local free list, and a global free list catches message buffers not cached by individual actors.

Feature-wise, the 2.03.00 release adds support for a new Actor::TailSend() method that exploits tail-call optimization to avoid thread switching overhead in the common situation where a message handler sends a message as its last operation. Instead of waking a separate thread to process the receiving actor in parallel, the receiving actor is typically processed by the thread processing the sending actor.

Version 2.02.00 released

22/06/10

Hot on the heels of the 2.01.00 release comes 2.02.00, another minor release with bugfixes and optimizations.

Various optimizations show a time reduction of around 40 percent in the included TokenRing benchmark demo (in the two worker thread case).

Bugfixes include an important fix to handling of messages sent to actors during garbage collection of those actors.

A new Theron::Metrics class allows capture of event counts, recording the number of messages passed, the number of actors processed, and so on. A new #define and makefile option enable the collection of metrics, which is off by default (naturally).

As always let me know if you find any bugs or have any questions or feedback.

Version 2.01.00 released

18/06/10

Version 2.01.00 is a minor release providing bugfixes and optimizations to the 2.00.00 release. It also adds support for forced function inlining and a new TokenRing demo, which serves as a benchmark of message sending and processing speed.

More optimizations are planned.

Version 2.00.00 released

12/06/10

Version 2.00.00 of Theron is now available for download.

This version represents a complete redesign and was rewritten pretty much from scratch. The intention of the redesign was to address a bunch of design issues highlighted by user feedback (and a rethink). Accordingly much of the API has changed, and there's no backwards compatibility with previous versions.

The good news is that the new design is much simpler and easier to use. A lot of the slightly weird stuff from the previous releases has gone. The core public API now consists of just seven classes.

Writing an actor is now as simple as deriving from the Theron::Actor baseclass. Everything else is up to you. Instead of a single catch-all Receive() method, you now register message handlers which are associated with the type of message they accept, using the C++ type system in an obvious way. Multiple handlers can be registered for the same message type. Handlers can be registered in the actor constructor, rather than just in a specialized Initialize() method as previously.

Actors no longer have input and output ports - the whole concept has been removed. There's no concept of an actor being "connected" to another actor; knowing the address of an actor is enough to be able to send it a message.

An important benefit is that the handling of messages within actors is now much easier to understand. Messages arriving at an actor are processed in strict arrival order. The processing of a message consists of executing any message handlers registered for the message type.

Message handlers can be safely registered, deregistered, and re-registered, from within any message handler, even themselves. So handlers can be registered or deregistered in response to received messages, changing the message interface of the actor dynamically.

Internally, the thread synchronization has been simplified by the removal of input ports.

Perhaps best of all, Theron now includes a makefile and builds out-of-the-box with gcc within, for example, MinGW. A VisualStudio solution is still provided.

The dependency on Windows threads has been resolved by adding support for using Boost Threads as the underlying threading implementation. The makefile build uses Boost Threads by default. Building with Boost Threads requires a built installation of Boost. Native Windows threads are still supported, so that the external dependency on Boost is avoided on Windows machines.

Finally, Theron now comes with a suite of twelve easy-to-follow samples, written from scratch and targeted at learning individual API features one at a time. An online tutorial on the website walks you through the samples. Plus, a new online user guide should help to make learning Theron far less painful than before.

As this is the first release of version two of Theron, it should be treated as a pre-release. Although tested fairly extensively by unit tests and samples, the new code hasn't yet been put to serious use in a large project. Therefore it may not yet be 100% production ready. Having said that it seems pretty stable and I don't know of any issues.

Be sure to get back to me with any bug reports or feedback. I'd love to hear what you build with Theron. I'd also like to thank the various people who have got in touch about previous releases, in particular Scott Gregory, Barak Amar, Geoff Burns, Jeffery Olson, Haimo Zobernig, James Osburn and Deepak Poondi.

Version 2.0

30/05/10

If you've been here before you'll notice that the website has been jigged around a bit. There must be a pretty good reason to get this guy off his ass, you think.

Well, you're right. I've been working on version 2.0 of Theron, which is going to be a complete rewrite and redesign. The new version massively simplifies a bunch of things - removing input and output ports and moving closer in spirit to the original Actor Model - so I hope it'll be a lot easier to figure out and more fun to use.

So a new website seems in order - maybe even one which actually tells you something useful about the library 8) I've been working this weekend on a set of online tutorials, which I think are looking promising.

I'm hoping to release at least an initial version in the next week or two. Subscribe to the RSS feed if you want to be kept informed.

More development

26/01/10

Lately I've been doing a bit of work on Theron in my spare time again. I don't want to get anyone's hopes up, but there may be another release in the pipeline at some point. I'm mainly working to improve the API and resolve some slight weirdnesses that a couple of helpful people have pointed out.

I've seen a couple of references to Theron on the web, and I've had a couple of interesting conversations with people, but I still don't know very much about who (if anyone) is actually using it, and what they like or don't like about it. So if you have anything to report, let me know.

I think the website could also use a serious overhaul. Now if I can just take a couple of weeks off work...

Inviting feedback

23/12/08

It's been a while since I made any changes at all to Theron or the website (theron.ashtonmason.net, in case you've forgotten), so some of you may be wondering what's going on.

The answer, predictably, is not much. After an initial burst of enthusiasm work on Theron has pretty much been on the back-burner. Mainly because nothing is driving the work. I'm not aware of anyone using Theron in earnest and frankly I have little idea what people make of it.

If you've downloaded Theron and found it interesting -- or even if you didn't -- I'd be interested, of course, to hear any and all feedback you might have. Likewise if you have any suggestions or requests, let me know. See the contact page on the site for contact info.

Fixed broken downloads

10/10/08

The source zipfile downloads are now working again.

Downloads are broken

09/10/08

I've managed to break the file downloads during some maintanance, hopefully I'll have them fixed tomorrow. Apologies for that.

New website

17/05/08

Welcome to the new Theron website. If you've been here before you may notice that much has been removed that was on the old site. This is somewhat temporary: the site has moved to a new server, and in the process it has been redeveloped from scratch. In time I plan to extend and improve it.

The last release of Theron was version 1.02.00 on 14 October 2007. Since then not a lot has happened. Basically I've been working on other things -- some web development and also my real job (games developer at EA). Theron, like all my projects, sees occasional rushes of enthusiams followed by months of languishing on the proverbial backburner.

As far as I'm aware, the 1.02.00 release is pretty functional and stable. But I can't claim to have used it in earnest much myself -- and I certainly haven't had much feedback either. If you've downloaded Theron (or even if you haven't) and have some thoughts to share then by all means drop me an email.

Version 1.02.00 released

14/10/07

This version adds support for runtime type-checking of message types by actor input and output ports, and improves the API reference documentation. The online documentation has also been updated and now matches the source code. In the process the search function has been fixed and the missing pages added.

Added online documentation

08/10/07

I've added online HTML documentation to the site. You can find it under 'documentation' in the menu. From what I've seen one or two pages are missing, plus in a couple of areas the documentation is more up to date than the code, in that it refers to unreleased code changes. But these things can and will be fixed.

Version 1.01.00 released

07/10/07

This is a relatively minor update that mainly completes actor garbage collection: previously unreferenced actors were only actually destroyed when their owning framework was destructed. Now they are continuously destroyed by a housekeeping thread (which otherwise spends most of its time asleep). See the release notes for more details.

The MessagesPerSecond benchmark that I added in the previous release now measures the message processing speed as around 300k messages per second. Previously I claimed this was 500k -- but even with the earlier code I now can't reproduce that. Strange. There is some variability naturally, but perhaps there's also some larger dependency on what is happening elsewhere in the OS. Or perhaps I was just deluded before :)

Version 1.00.00 released

04/10/07

This version is the first 'proper' release and adds significant new features and improvements.
You can now create multiple frameworks, each with their own independent pool of threads. Actors are now reference counted and automatically garbage collected once they become unreferenced (although note that deletion is currently deferred until destruction of the owning framework).
Memory allocation can be customized and controlled by the provision of custom allocators, including a built-in pool allocator for internal message queues. There have also been significant optimizations, and Theron now processes over half a million messages per second on my PC. Some work has been done to remove dependencies on Visual C things like Microsoft STL, and to reduce the dependency on Win32 threads. Lastly, the samples have been extended and a set of unit tests added.

See the release notes for full details.

Version 00.00.02 released

08/09/07

Like the previous release, this is a minor
update. It adds API reference documentation, something that was sorely lacking from the previous releases.