Lock-Free Data Structures. The Evolution of a Stack -- Max Khiszinsky

Max Khiszinsky describes in his recent blog article different approaches to develop concurrent containers.

Lock-Free Data Structures. The Evolution of a Stack

by Max Khiszinsky

From the article

Describing the known algorithms would be quite boring, as there would be a lot of [pseudo-]code, plenty of details that are important but quite specific. After all, you can always find them in the references I provide in articles. What I wanted was to tell you an interesting story about exciting things. I wanted to show the development of approaches to designing concurrent containers.

Quick Q: Why does ~shared_ptr amazingly know how to call the right destructor? -- StackOvervflow

Quick A: Because shared_ptr is awesome and remembers the correct deleter to call.

Recently on SO:

Why does incomplete type of smart pointer data member and raw pointer data member have different behavior when their parent destruct?

In the following code:

smart pointer data member pImpl(class Impl) and raw pointer pc(class CAT) all are incomplete data type, there is no definition of these two classes in Widget.h ...

... For the raw pointer data member, its destuctor is not called when widget object is destructed.

While the shared_ptr data member, its destructor has been correctly called.

... Why do shared_ptr data member and raw data member have different behavior when the widget gets destructed?

Interview with Scott Meyers at Yandex -- Coder_CPP

In case you missed the transcript a few days ago on Reddit:

Interview with Scott Meyers at Yandex

by Coder_CPP

From the interview:

... So I don’t think that in ten years everyone will be using managed languages. I think that C++ is going to remain an extremely important language for production use. Simply because if your goal is to get the maximum of performance out of the machine. If that is what is most important to you. I think that even these days the primary competitors are C and C++. Those are pretty much your choices. And C++ is just a much more expressive language. I have to say that I’m not a C programmer. I've never really been a C programmer. But I think that just a simple notion of destructors is so unbelievably powerful, that as a C programmer I would consider moving to C++ just so I could compile and get destructors. And, obviously, there is a lot more? to it than that...

Dive into C++11 - [5] - Game entity management basics

The intended audience for this tutorial/screencast are people who have some experience with C++ in general, and who watched the previous episodes. This episode also teaches the basics of polymorphism and component-based design.

Dive into C++11: Episode 5

by Vittorio Romeo.

From the author: 

I greatly appreciate comments and criticism, and ideas for future videos/tutorials. Feel free to fork/analyze the source code at: https://github.com/SuperV1234/Tutorials You can find the previous episodes here: Playlist

C++ Tail Recursion Using 64-bit variables -- Giovanni Campo

Leveraging the elegance of recursion:

C++ Tail Recursion Using 64-bit variables

by Giovanni Campo

From the article:

Main disadvantage of Recursion in imperative languages is the fact that not always is possible to have tail calls, which means an allocation of the function address (and relative variables, like structs for instance) onto the stack at each call. For deep recursive function this can cause a stack-overflow exception because of a limit to the maximum size of the stack, which is typically less than the size of RAM by quite a few orders of magnitude.

Semaphores are Surprisingly Versatile --Jeff Preshing

An interesting approach on how semaphores could be used in Modern C++ multithreaded programming:

Semaphores are Surprisingly Versatile

by Jeff Preshing

From the article:

In multithreaded programming, it’s important to make threads wait. They must wait for exclusive access to a resource. They must wait when there’s no work available. One way to make threads wait – and put them to sleep inside the kernel, so that they no longer take any CPU time – is with a semaphore.

I used to think semaphores were strange and old-fashioned. They were invented by Edsger Dijkstra back in the early 1960s, before anyone had done much multithreaded programming, or much programming at all, for that matter. I knew that a semaphore could keep track of available units of a resource, or function as a clunky kind of mutex, but that seemed to be about it.

My opinion changed once I realized that, using only semaphores and atomic operations, it’s possible to implement all of the following primitives:

  1. A Lightweight Mutex
  2. A Lightweight Auto-Reset Event Object
  3. A Lightweight Read-Write Lock
  4. Another Solution to the Dining Philosophers Problem
  5. A Lightweight Semaphore With Partial Spinning ...

Refactoring my Qt database code

I spend some time on refactoring my database code in Qt:

Refactoring my Qt database code

by Jens Weller

From the article:

For two days I had the chance to clean up my code and do a little refactoring. One of the results is, that my database code now also uses variadic templates. For some time now, I use Qt as the UI and Database frontend of my applications...

How Much Should You Pay Your Enginners? (Infographic) -- Cheyenne Richards

techsalaryguide15.PNG

We take all published measurements with a grain of salt, but we weight in favor of those based on interview data -- it's more difficult to gather, but far more accurate, than those based on heuristics applied to automated web search queries.

How Much Should You Pay Your Enginners? (Infographic)

by Cheyenne Richards

Hat tip to Kira M. Newman reporting at tech.coFrom Newman's intro:

Today, Startup Compass released the results of a global survey of engineers that provides a wealth of information about startup salaries -- including the highest-paying programming languages.

Published as “How Much Should You Pay Your Engineers?,” the results are based on a study of Startup Compass members plus data pulled from oDesk, Elance, Toptal, Glassdoor, AngelList, and Payscale...

One conclusion from the data, that resonates with C++ hiring managers: There is no oversupply of capable C++ developers.

Join our C/C++ compiler experts at the first annual #OpenPOWER summit next week -- Larry Lindsay

openpower15.PNGIf you're in the San Francisco Bay area, you might be interested in this from IBM:

Join our C/C++ compiler experts at the first annual #OpenPOWER summit next week

by Larry Lindsay

From the announcement:

Next week the First Annual OpenPOWER Summit takes place in San Jose, California from March 17-19... The XL C/C++ compiler team will be presenting two sessions on the latest compilation technology advancements...

CppCon 2014 Accept No Visitors--Yuriy Solodkyy

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:

Accept No Visitors

by Yuriy Solodkyy

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Visitor Design Pattern was an attempt to overcome a limitation of object-oriented languages - inability to retroactively introduce new polymorphic functions. While it was quite efficient in providing extensibility of functions, it was never truly retroactive, easy to teach, use or maintain, and it achieved this at the cost of hindering extensibility of classes, introduction of control inversion and requiring tons of boilerplate code to be written. Visitor Design Pattern is a workaround, not a solution to the problem and in this talk I would like to discuss a more elegant yet as efficient solution in the form of a Match statement. We will look at several use-cases for the Visitor Design Pattern, their encoding using both approaches and ultimately their advantages and disadvantages.