Showing posts with label bookmark. Show all posts
Showing posts with label bookmark. Show all posts

Saturday, June 29, 2013

The Internet knows Bitcoin

Very interesting to see more and more Bitcoin spread in the Web as well as real life. Here is a nice and illustrative video about what Bitcoins are. The Internet knows Bitcoin

Saturday, August 22, 2009

The safe Bool ideom

Operator overloading is considered a major C++ feature. But as so often with C++ this feature sometimes clashes with other language properties.

Roker pointed me to an article about the safe bool idiom where the author elaborates on why a simple operator bool is not satisfying if you want to be able to use an object within a bool context. Have fun...

Monday, June 22, 2009

C++ truths

Since I am at the ETH in Zurich I haven't used C++. The reason is simply the fact that I haven't encountered any problem for which C++ is the tool of choice. That's why there has been almost no input to this category from me

But there are others who blog about C++. So I will be satisfied with passively following the C++ topic and refering to them.

Today's featured C++ blog is C++ thruths from Sumant Tambe. Hmm, infinite regress, yummy. ;-)
Thank you Roker

Wednesday, May 20, 2009

The longest suicide note in history

I am not alone with my estimation of C++ being a dead end. Today Roker pointed me to an article from Allan Kelly about the future of C++. Here is my favourite quote:
[the C++ 0x standard will be] the longest suicide note in history.
Other languages do better. Python 3.0 and Perl 6 are not downward compatible and in both cases I think this is a good idea. Why is this impossible for C++?

Monday, March 9, 2009

Thread Building Blocks

Intel Thread Building Blocks (TBB) is a open source C++ library. Its aim complies with the one of OpenMP: taking advantage of multi-core processors without being an expert on parallel programming.

TBB provides a rich and pretended complete set of algorithms, containers, models and primitives for concurrent software. I would really call it the C++ library for concurrent programming. Though its great flexibility comes hand in hand with its complexity. You have to dig into the documentation for quite a while before you get you work done. And compared to OpenMP or Cilk++ you must understand more about concurrency.

Furthermore compared to OpenMP or Cilk++ your concurrent-enabled code looks very different to its sequential equivalent. TBB programs must be designed to use TBB from the beginning.

Cilk++

Cilk ARTS is a MIT spin-off which develops Cilk++, an enhancement of the Cilk Project.

Cilk++ is similar to OpenMP in that way that you specify the program's concurrency structure with special keywords. The tool chain and the run time thereby turn your sequential program into a highly concurrent one. Cilk ARTS focuses on porting existing software on multi-core systems with least possible knowledge about concurrent programming.

In my opinion the most important part of their tool chain is the "Race Detector". Cilk ARTS claims that it detects any existing data race in the program. This means, if the Race Detector finds no error, the concurrent program is correct if and only if the sequential one is. And the correctness of the latter is already checked with traditional software tests.

I have no idea how the Race Detector works. And I'm afraid they won't tell anybody any details. What they say is that they test if all possible schedulings result in the same values of the data. But how does the Race Detector get all possible threads of execution without automatically "understanding" what the code does?

OpenMP

OpenMP is a set of compiler directives and a run time environment which enable programmers to implement fork-and-join models very easy.

Fork-and-join means that a sequential program comes to a point where parallel execution is possible and meaningful. At this point multiple threads of execution are started which do all the partial computations in parallel. When everything is done the partial results are collected and aggregated and the threads are joined. From there on the program is sequential again.

With OpenMP's compiler directives you simply specify the programs concurrency structure. Everything else is done automatically by the compiler and the OpenMP run time environment. Your program becomes highly concurrent and you don't see a single lock or a thread. Everything happens behind the scenes. Nevertheless it is possible to configure scheduler algorithms and parameters.

Wikipedia has a great article about OpenMP. No need to repeat everything here. If you have a program which fits the fork-and-join model you definitely want to give OpenMP a try.

Sunday, February 8, 2009

lock-free dynamic memory allocation

In 2004 Maged M. Michael introduced the first lock-free dynamic memory allocation.

According to his benchmarks his implementation outperforms standard memory allocation libraries. For me this is the main advantage of non-blocking synchronization for high-load systems. Simply by avoiding taking locks things speed up considerably.

Maged M. Michael released his implementation into open source through the Amino - Concurrent Building Blocks project.

non-blocking synchronization

One of my current fields of interest is non-blocking synchronization. Wikipedia has a good introductive article on this topic. Non-blocking synchronization is of interest for pervasive computing because this technique among other things makes software more robust as it avoids dead-locks and inversions of priority, which are well-known problems of embedded software.

As far as I know the fundamentals of this topic origin from Maurice Herlihy, published first on 1991 in his paper wait-free synchronization.

Monday, May 14, 2007

Reading C type declarations

If you are interested, in what exactly char *(*(**foo[][8])())[]; declares go on an read this.

Yes, this is no C++ but a C topic. But as ISO C++ is (almost) a superset of C89 this nevertheless matters. Furhtermore it's fun. And a good example on how a language should not be defined.

Wednesday, May 9, 2007

Barriers

In addition to my post about why it is a problem that the compiler does not know anything about threads I recommend this article about memory barriers and multi core machines.

And please help him find pi :-)

Memory Layout for Multiple and Virtual Inheritance

I recommend this article about the memory layout of C++ objects.

Sunday, February 11, 2007

C++ Reference Guide

IMO the definit C++ Reference Guide out there is this one.

Especially check out the outlook on the upcoming C++0x standard.