Lockless Queues
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
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement