CppCon 2014 ...Scaling Visualization in concurrent C++ programs—Fedor G Pikus

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

...Scaling Visualization in concurrent C++ programs

by Fedor G Pikus

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

High performance is one of the main reasons programmers choose C++ for their applications. If you are writing in C++, odds are you need every bit of computing power your hardware can provide. Today, this means writing multi-threaded programs to effectively utilize the multiple CPU cores that the hardware manufacturers keep adding. Everyone knows that writing multi-threaded programs is hard. Writing correct multi-threaded programs is even harder. Only after spending countless hours debugging race conditions and weird intermittent bugs do many programmers learn that writing efficient multi-threaded programs is harder yet. Have you ever wanted to see what are all your threads doing when they should be busy computing? This talk will show you how.

We begin by studying several techniques necessary for collecting large amounts of data from the running program very efficiently, with little overhead and minimal disruption to the program itself. We will cover efficient thread-safe memory management and efficient thread-safe disk I/O. Along the way we dabble in lock-free programming just enough to meet our needs, lest the subject will spiral into an hour-long talk of its own. With all these techniques put together, we can collect information about what each thread is doing, which threads are computing and what exactly, and which threads are slacking off waiting on locks, and do it at the time scale of tens of microseconds if necessary. Then we process the collected data and create a timeline that shows exactly what the program was doing at every moment in time.

Iterators++, Part 3—Eric Niebler

Eric Niebler concludes his series about proxy iterators with:

Iterators++, Part 3

by Eric Niebler

From the article:

This is the forth and final post in a series about proxy iterators, the limitations of the existing STL iterator concept hierarchy, and what could be done about it. The first three posts describe the problems of proxy iterators, the way to swap and move their elements, and how to rigorously define what an Iterator is.

This time around I’ll be focusing on the final problem: how to properly constrain the higher-order algorithms so that they work with proxy iterators.

N4388: A Proposal to Add a Const-Propagating Wrapper to the Standard Library—J Coe, R Mill

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4388

Date: 2015-02-25

A Proposal to Add a Const-Propagating Wrapper to the Standard Library

by Jonathan Coe, Robert Mill


We propose the introduction of a propagate_const wrapper class that propagates const-ness to pointer-like member variables. ... The behaviour of const member functions on objects with pointer-like data members is seen to be surprising by many experienced C++ developers. A const member function can call non-const functions on pointer-like data members and will do so by default without use of const_cast...

A conditional copy constructor—Andrzej KrzemieĊ„ski

Andrzej writes in his recent blog about an issue library writers have to take care of.

A conditional copy constructor

by Andrzej Krzemieński

From the article:

In this post we will try to define a ‘wrapper’ class template that does or does not have a copy constructor depending on whether the wrapped class has it. This will be a good opportunity to explore in depth a couple of advanced C++ features. Note that this is a rather advanced topic and, unless you are writing or maintaining a generic library, you will probably never need this knowledge.

CppCon 2014 Meta Techniques: Heterogeneous Polymorphism&Fast Prototyping at Facebook—Marcelo Juchem

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Meta Techniques: Heterogeneous Polymorphism & Fast Prototyping at Facebook

by Marcelo Juchem

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

As data driven systems evolve there's an ever growing demand for bringing new functionality into existing systems in an efficient, maintainable and least intrusive manner. When implementing features with different semantics or interfaces, virtual inheritance requires a compromise between design simplicity and performance. This implies a need for new techniques to achieve heterogeneous polymorphism efficiently. With C++11 and 14, type lists, type maps and variants can now be trivially implemented by the initiated. Facebook moves fast so we quickly adopted the new standards to further explore the capabilities of the type system. This talk demonstrates some meta-programming techniques like reflection and compile-time built structures to achieve heterogeneous polymorphism and fast prototyping.

C++ User Group Meetings in March

The monthly overview on the upcoming C++ User Group Meetings:

C++ User Group Meetings in March

by Jens Weller

The list of this month meetings:

4.3 C++ UG Saint Louis - DD Part 3 - C++11/14 Standard Libraries
5.3 C++ UG Paris - C++ FRUG #6 - La métaprogrammation, non non ca sert en vrai
11.3 C++ UG Utah - Graphics and Audio with Cinder
11.3 C++ UG Hungary - More Effective STL
11.3 C++ UG San Francisco/ Bay area - Experience with C++11 in ArangoDB
12.3 C++ UG NRW/Aachen - C++ User Gruppe (März)
12.3 C++ UG Dresden - Coding Dojo
12.3 C++ UG New York - How to Write A Shared Library
16.3 C++ UG Denver - C++ Lightning Talks
16.3 C++ UG Austin - North Austin Monthly C/C++ Pub Social
17.3 C++ UG Chicago - Richard Stallman
17.3 C++ UG Edinburgh - C++ Edinburgh
17.3 C++ UG Montpellier - Rencontre C++ mars
17.3 C++ UG Berlin - monthly meeting
18.3 C++ UG Bristol - Save the date
18.3 C++ UG Düsseldorf - Treffen der C++ User Gruppe NRW
18.3 C++ UG Ann Arbor - Meet & Greet
18.3 C++ UG Hamburg - C++ in der numerischen Programmierung
19.3 C++ UG Ruhrgebiet - surprise, surprise
24.3 C++ UG Portland - PDXCPP March Meeting
25.3 C++ UG San Francisco/ Bay area - Workshop and Discussion Group
26.3 C++ UG Bremen - First meetup
26.3 C++ UG Rhein-Neckar - C++ Usergroup Meeting
26.3 C++ UG Munich - Monthly Meeting
26.3 C++ UG Madrid - Sistemas Distribuidos con ZMQ y Google Protocol Buffers
27.3 C++ UG Istanbul - Smart Pointers - from 03 to 17

Vector Hosted Lists—Thomas Young

Want perfomance and speed? Vectors are the solution:

Vector Hosted Lists

by Thomas Young

From the article:

Vectors are great when adding or removing elements at the end of a sequence, but not so hot when deleting elements at arbitrary positions.

If that's a requirement, you might find yourself reaching for a pointer-based list.

Not so fast!

Memory locality is important, contiguous buffers are a really good thing, and a standard vector will often out-perform pointer-based lists even where you perform non-contiguous, list-style modifications such as arbitrary element deletion.

And we can 'host' a list within a vector to get the advantages of a contiguous buffer at the same time as 0(1) complexity for these kinds of manipulations...

Comparison of C++ Format and C library’s printf—Victor Zverovich

The C printf family is still the gold standard of performance for formatted I/O, but woefully fragile and inextensible. C++'s iostreams offers important advantages in type safety, but struggles with performance and internationalization.

A number of projects, such as Boost.Format, try to the advantages of both. Here's further discussion about one such library we linked to recently:

Comparison of C++ Format and C library's printf

by Victor Zverovich

From the article:

I was recently asked on GitHub why would someone use fmt::printf, which is a part of the C++ Format library, over the standard C library printf. This is a fair question and so I decided to write this blog post comparing the two.

Disclaimer: I’m the author of C++ Format, so this is all very biased =).

Google releases gRPC—Mugur Marculescu

A new open source HTTP/2 RPC Framework for C++ and other languages has been released.

Introducing gRPC, a new open source HTTP/2 RPC Framework

by Mugur Marculescu

From the article:

Today, we are open sourcing gRPC, a brand new framework for handling remote procedure calls. It’s BSD licensed, based on the recently finalized HTTP/2 standard, and enables easy creation of highly performant, scalable APIs and microservices in many popular programming languages and platforms. Internally at Google, we are starting to use gRPC to expose most of our public services through gRPC endpoints as part of our long term commitment to HTTP/2.