Jump to content

Recommended Posts

Posted

I need to implement a non-blocking wait free Queue which needs to be linearizable. is this possible with an ArrayList if that ArrayList is declared to be volatile?

Posted
I need to implement a non-blocking wait free Queue which needs to be linearizable.

 

That's quite the sentence there. I'm having a bit of trouble wading through your jargon.

 

You want a queue to communicate between threads (I assume?) and want for it to be atomic in some manner? Do you mean thread-safe?

 

Non-blocking is a term I'm most familiar with in the context of I/O. Do you mean you want it to be lock-free?

 

If I'm reading this right, you want a lock-free queue which is thread safe. If that's the case, what you're asking for is pretty much impossible. A queue used for interthread communication will generally need a combination of a lock and a condition.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.