Jump to content
  • Advertisement
Sign in to follow this  
lordcorm

Lockless Queues

This topic is 3712 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Yeah, the queue can be accessed freely from any thread. The stuff you get/put from/into it still needs thread-safety considerations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!