Quantcast
Channel: semaphore – Alex on Linux
Browsing all 3 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

Image may be NSFW.
Clik here to view.

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 Introduction How atomic variables...

View Article
Browsing all 3 articles
Browse latest View live


Latest Images