Product News

ASIO: Portable Stackless Coroutines in One* Header -- Chris Kohlhoff

Via C++ Next, hat tip to Dave Abrahams:

Chris Kohlhoff’s ASIO library contains an extraordinary little header, not in the public interface, but in the examples directory, that implements what he calls “Stackless Coroutines” (very similar to Python’s Simple Generators if you’re familiar with those). He does it completely portably, with just a few macros, and considering that there are zero lines of platform-specific code, they work amazingly well.

Dave cites this article that describes how to use the coroutines:

A potted guide to stackless coroutines

Keen-eyed Asio users may have noticed that Boost 1.42 includes a new example, HTTP Server 4, that shows how to use stackless coroutines in conjunction with asynchronous operations. This follows on from the coroutines I explored in the previous three posts, but with a few improvements. In particular:

  • the pesky entry pseudo-keyword is gone; and
  • a new fork pseudo-keyword has been added.

The result bears a passing resemblance to C#'s yield and friends. This post aims to document my stackless coroutine API, but before launching into a long and wordy explanation, here's a little picture to liven things up...

VC++ 2012 Desktop Express (free)

Today Microsoft released another free Express version of Visual C++ 2012. In addition to the free Express Visual C++ compiler for building tablet applications, Visual Studio Express 2012 for Windows Desktop directly supports traditional Windows and command-line applications in C++.

This a great free C++ compiler on Windows for everything from hobby development to using and contributing to open source projects. Besides additional C++11 standards conformance with range-for, override and final on the language side (with more to come in the coming months; watch this space) and a complete C++11 standard library implementation, the free compiler also includes unit testing framework for C++, code analysis for C++ (try /analyze today if you haven't already, as John Carmack says so well), C++ AMP for GPGPU programming, and much more.

See also the longer announcement here.

just::thread 1.8.0 released

Version 1.8.0 of just::thread was released today. just::thread is Just Software Solutions' C++11 Thread Library.

What's new:

  • The big news with this release is the new support for Microsoft Visual Studio 2012, so you can continue to take advantage of just::thread when upgrading your compiler.
  • A fix for using just::thread in a DLL on Windows XP.
  • Minor fixes and improvements to the generated code across all platforms.

Boost 1.51.0 released

Release 1.51.0 of the Boost C++ Libraries is now available.

These open-source libraries work well with the C++ Standard Library, and are usable across a broad spectrum of applications. The Boost license encourages both commercial and non-commercial use.

This release contains 1 new library (Boost.Context, by Oliver Kowalke) and numerous enhancements and bug fixes for existing libraries.

Thanks,

--The Boost release team

    Beman Dawes
    Daniel James
    Eric Niebler
    Marshall Clow
    Rene Rivera
    Vladimir Prus