ACE Library for C++

I’ve been using the ACE C++ library recently and I’m very impressed. It’s an extremely fast portable networking and server-architecture library.

  • Portable primitives for sockets, threads, synchronization, logging, and many other basic components
  • “Plug-and-play” pattern architectures for building high-speed servers
  • A suite of IPC tools for fast portable inter-process communication
  • Extra portability tools such as replacement containers, allocators, strings, etc., in case some of your target platforms don’t have good standard libraries

For me, the magical portability features are huge. I like to develop on Windows and deploy on Linux, but doing this used to be very stressful. The ACE library really takes the nightmare out of it, though. I used to grit my teeth and prepare for serious headaches whenever I copied my Windows code over to the Linux box, but now I trust that it’s going to Just Work.

I think there are two reasons this library hasn’t been a runaway success yet. First, the online tutorials are sub-par. The online references are fine, but for a tutorial you really need to buy the book.

The other problem is that it’s really two libraries in one. It’s both a low-level utility collection and a high-level pattern library in one, and this can cause a bit of a mental disconnect to people who are looking for one half or the other.

Even so, with the book in hand I was up and running in less than a day. I’m very comfortable with C++, so your mileage may vary, but I found it pretty painless. 

The ACE library should be a serious consideration as part of your MMO server architecture, either as the foundation of a full server or as a plug-in replacement for underperforming components written in other languages. This library makes C++ much more appealing as a server platform.

Now if there was only a similar C++ library for portable SQL interfaces…

This entry was posted in Programming. Bookmark the permalink.

4 Responses to ACE Library for C++

  1. I can personally attest that ACE is used in many MMOs, particularly in China. Here in the US “not invented here” syndrome is still a very common disease, however. I will say that I’m impressed you were able to do anything meaningful with ACE in just one day; I know you’re one of the shinier apples out there but that still must be a fairly good book ;). ACE is very large and very complex. Its not always obvious how you’re supposed to use it. The only downside to ACE is that you tend to need the entire framework and its hard to pick out just the parts you want. I’m also not a huge fan of CORBA and ACE is really designed for use along with TAO. Still, its battle tested production quality code that works well on the platforms it supports.

    To learn more, check out its home on the web:

  2. Eric says:

    The book is pretty important for getting started. The low-level components, especially, are not of the “look at the header files and go” variety. :) And to use the book efficiently you do have to be comfortable with both low-level C concepts as well as high level C++ templates. It’s not a terribly hand-holdy book; it just jumps in and starts explaining things as fast as it can.

    Some of the most powerful ACE components are for use with TAO, but you can definitely get a lot of mileage with just the stand-alone base ACE algorithms.

  3. emanon says:

    ACE is really solid, but as you say it does take time to figure it all out.
    If you can find it, there’s a great set of documentation that was done by a guy teaching people at Boeing(I think it was boeing anyway).

  4. Steve Huston says:

    It’s great to hear that ACE is helping MMO developers as well as others. I’m also impressed that Eric was up and running with ACE in a day. Congrats!

    Quick follow-up on a couple of the previous comments:
    – ACE pre-dates TAO by about 10 years… the research group that had a big hand in developing ACE has moved on to TAO (and other distributed object computing areas) so TAO et al gets a lot of attention from that crowd. ACE has a lot of interest and support as well, but when everything is working, there tends to be less noise :-)

    – The tutorial from the “Boeing” guy was most likely from Umar Syyid at Hughes. Umar (and James CE Johnson, author of another set of tutorials) teamed up with me to co-write “The ACE Programmer’s Guide”. The older tutorials later went unmaintained and were subsequently removed from the ACE distribution.

    Good point about ACE being multiple layers that aren’t readily apparant… will try to fix that.