Re: [sigc] Re: [gtkmm] libsigcx and gtkmm 2.4



Martin Schulze wrote:

This gives rise to an interesting question: If no locking is required (e.g. because atomic operations are used), which is the most efficient call to establish a memory barrier (e.g. before doing the atomic operation)? In a linux driver, I would call wmb(), but what can I do on the application side? Signal a dummy condition?


I'm pretty sure there isn't a portable way of doing that without locking. Even if threads agree on memory contents at the actual point of syncronization, they will not stay syncronized for long. The atomic operation needs to run within the scope of syncronization, and the mechanism to implement that is architecture dependent.

It shouldn't really matter, though, as there's no portable way of issuing an atomic operation either. At least not in C/C++.

--
Christer Palm



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]