Quantcast
Channel: Alex on Linux » synchronization
Browsing all 7 articles
Browse latest View live

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...

View Article



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. Quiet often you want to protect some simple data...

View Article

pthread mutex vs pthread spinlock

Update 06/16/2009: On several occasions, commentators to this article pointed out that this post is somewhat incomplete. Therefore, before I continue, I would like to make some things clear. Before...

View Article

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.

View Article

Models for multithreaded applications

As you know, I changed a couple of workplaces during my career. Long story short, one interesting thing that I noticed in different companies is various models for multi-threaded programs (mostly for...

View Article


Image may be NSFW.
Clik here to view.

tcpdump for Dummies

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...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article
Browsing all 7 articles
Browse latest View live


Latest Images