Lockless Queues

Started by
2 comments, last by lordcorm 15 years, 10 months ago
Im having a little trouble sorting out what a lockless queue is and when to use it. What i want to know is: * is it a way to make variable accessing safe on any thread? For any purpose? Or is it just a normal stl queue that is lock-less for storing information? * when using it, do i have to push every variable that i want to be threadsafe into the queue when i want to modify the variable? * or, do i have it all wrong? Please enlighten me. Lordcorm
Advertisement
Without any further context, a lockless queue is a queue container that has been made threadsafe by using a lockfree algorithm, ie. one that uses special CPU instructions (CAS or similar) to avoid locking a thread (like a critical section or mutex would do). This allows for significant performance increases if many threads try to access the queue concurrently.

It doesn't mean anything more than that.
Yeah, the queue can be accessed freely from any thread. The stuff you get/put from/into it still needs thread-safety considerations.
Ok, thx for the replies guys, very much appreciated.

This topic is closed to new replies.

Advertisement