Archive for the ‘Articles’ Category

How to handle SIGSEGV, but also generate a core dump

Recently I ran into this problem. How do you capture SIGSEGV with a signal handler and still generate a core file? The problem is that once you have your own signal handler for SIGSEGV, Linux will not call default signal handler which generates the core file. So, once you got SIGSEGV, consider all that useful […]

Multithreaded simple data type access and atomic variables

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion IntroductionBACK TO TOC In this article I would like to continue subject I started in my previous two posts (post 1 and post2). Question I am trying to answer is what […]

pthread spinlocks

Continuing my previous post, I would like to talk about relatively new feature in glibc and pthreads in particular. I am talking about spinlocks.

Do you need a mutex to protect an int?

Recently I ran into few pieces of code here and there that assumed that int is an atomic type. I.e. when you modify value of the variable from two or more different threads at the same time, all of the changes you’ve made to the value will remain intact. But really, can you modify variables […]

How inheritance, encapsulation and polymorphism work in C++

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]

32bit vs 64bit computers, the QA

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]

Swap vs. no swap

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]

Few problems that you may encounter when booting Linux

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]

sed – the missing manual

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]

Aligned vs. unaligned memory access

Table of contents Introduction How atomic variables work Atomic variables size limitations Use cases The real thing… Time to see some action Precautions Conslusion Introduction Encapsulation How methods work How overloading works How mangling solves the problem Structure and size of the object How inheritance and polymorphism work How basic polymorphism works How multiple inheritance […]