Boost logo

Boost Users :

Subject: Re: [Boost-users] newbie thread synchronization question
From: Rudolf Leitgeb (r.leitgeb_at_[hidden])
Date: 2009-02-27 05:26:07


> will it work reliably on a multi-core machine? When the mutex unlock()
> happens, does that flush the CPU cache and write the value of s.qty to
> main memory? Does the mutex lock() operation clear the CPU cache and
> force a reload of s from the main memory? I'm trying to understand how
> synchronization works among multiple cpus.
>
> I've only worked on multithreaded code in Java and there the memory
> model is well defined. AFAIK, that isn't the case in C++.

I have never encountered a C/C++ thread library which would not reliably
work on multi core systems. libpthread works well and I assume boost
uses libpthread as underlying base (at least on unix based systems).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net