Posts Tagged ‘C++’

printf() vs stream IO in C++

Before joining Dell I was mostly working in kernel writing in C programming language. At Dell I still work on mostly low level stuff, but this time it is user-mode, so I am not tied up to C anymore. We’re writing in C++ and I am learning C++. One of the less appealing things for […]

gcc macro language extensions

One of the great things about gcc and in particular its C/C++ preprocessor is various extensions that it has. In this post I would like to briefly describe three of them. One allows to turn C/C++ token into a string. Here token is anything that you can pass as an argument to a macro. Second allows you […]

pthread_exit() in C++

Today I ran into an interesting problem that I would like to share. I am working on multi-threaded code in C++. Here’s what happened. I started a thread that looks like this: try { do_something() } catch (…) { std::cout << “Got unknown exception” << std::endl; } The do_something() routine eventually called pthread_exit(). Once I […]

Call a constructor or allocate an object in-place

Since I joined Dell, my main field of research and work has somewhat changed. Now I am mostly working with C++ and file-systems. This world is not entirely new to me, but apparently I have a lot of stuff to learn. Today I’d like to talk about one nice trick that I learned few days […]

Mono is here to stay, period?

There has been a new development in the subject I raised a day ago. It seems that there has been some effort on Microsoft’s side to clarify the legal issue with the Mono Project. According to this article in iTWire, Microsoft will extend its Community Promise to the C# and CLI standards.

Mono is here to stay

There’s an ongoing discussion about the Mono project. Mono is somewhat controversial because it is an open source implementation of C# programming language and .NET platform. Mono has constantly being bullied because both C# and .NET are creations of the cause of all evil on earth, Microsoft corp.

New article – C/C++ reference counting with atomic variables and gcc

This article explains how to implement performance critical reference counting in C/C++ program, using atomic variables and gcc. Enjoy it. Read the article here.

C/C++ reference counting with atomic variables and gcc

Table of contents Introduction What reference counting needed for? This is how we will use atomic variables to count references to objects The naive approach The RCU approach Where atomic variables coming from? Conclusion IntroductionBACK TO TOC Lets say we have a data structure that manages objects and we would like to manipulate the data […]

How inheritance, encapsulation and polymorphism work in C++

Table of contents Introduction What reference counting needed for? This is how we will use atomic variables to count references to objects The naive approach The RCU approach Where atomic variables coming from? Conclusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance […]