What are C++11 atomic classes? [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to know what are "C++11 atomic classes" that GCC-4.7.2 talks of in the 4.7 changelog. I have tried Googling but didn't get any useful information on this. Does this mean that all operations are atomic so the class is thread-safe and operations are linearizable?

To quote from this reference:
The atomic library provides components for fine-grained atomic operations allowing for lockless concurrent programming.
So in short yes all operations on an atomic variable are, well, atomic, and therefore threadsafe.

Related

Replace critical section with boost::detail::spinlock cause dead lock on windows [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
My platform is vs2010 win2003 server, I have an application working well. There is an integer protected by a critical section, when I modify and use boost::detail::spinlock instead then it goes to dead lock.
It's boost::detail::spinlock. That means it's intended for internal use only. If you want portable replacement for critical sections, use boost::mutex from Boost.Thread.
It's boost::detail::spinlock. Spinlocks usually busy-wait, which makes them faster, but usable only under tightly controlled conditions.
Boost 1.53 (the latest release) finally got Boost.Atomic, which is a portable (and C++11 compatible) replacement for interlocked operations.

Lockless vector [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I recently got interested in lockless programming and attempted to write implement a fixed-size mostly-lockless vector (github link). While it works, I'd love to get some feedback from more experienced people if my logic looks buggy or suspicious.
Are there any standard techniques that are particularly useful when testing out lockless data structures?
std::vector is lockless. In general, any good vector implementation will be lockless, because the granularity of a vector is too low for locks to be of any use.

Readers–writer lock Multithreading Scenario? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have read a few links about Readers–writer lock. I had few doubts.
In case the system has to be designed for Multiple reads and single write ,and write should have priority.
In case the system has to be designed for multiple reads and multiple write
So should we be implementing a semaphore for multiple read and a mutex for multiple write? or when do i use a critical section?
Also,Does it depend on the operating system? (does it differ in case of Unix and Windows)?

CPU caches aware C++ / C programming [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was going through Scott Meyer's podcast on CPU CACHES AND WHY YOU CARE It seems this will make code run faster, is there any open source where such coding is done for reference.
Or anybody has example of design of data structures/algorithms based on CPU caches aware
Sure, the entire Linux kernel is implemented to be cache-aware.
For more details there is highly recommended paper What Every Programmer Should Know About Memory.
Linear algebra is sensitive to cache problems. The BLAS subroutines allow one to abstract away from these concerns

Problem with Atomic operations on a intel XScale(ARM) processor - XScale-IXP42x Family - c++ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
We are facing a possible problem on ARM processor machine.
We have done an implementation for smart pointers,which involves atomic operation for keeping track of the references.
We are getting crashes for that.
Is there a possible problem with atomic operations on ARM processor?
It's possible, but it's way more likely that there is a bug in your code.
Perhaps you should post some code.