[concurrency-interest] Project Amino: Introduce Lock-Free Stack
Gregg Wonderly
gregg at cytetech.com
Fri Aug 7 10:10:27 EDT 2009
Jed Wesley-Smith wrote:
> Hi David, my previous email didn't address your points directly:
>
> David Holmes wrote:
>> But for that matter does a concurrent stack make sense? What defines a
>> stack? The fact that items are removed in the opposite order to which
>> they
>> are added. But in a concurrent environment how can you tell? :) Maybe
>> all we
>> really need is an approximation of last-in-first-out, and a sequential
>> stack
>> is a sufficient but not necessary solution to that problem.
>>
>> Ditto for a ConcurrentQueue or ConcurrentDeque.
>>
>
> As I pointed out in my previous reply, they probably only don't make
> sense if strict fairness is required, besides you particularly need to
> know if you want to use them with single or multiple readers or writers.
>
>> At this point I await someone who is really an expert on concurrent data
>> structures to chime in :-)
>
> Let's hope so!
I think it's probably not a good idea to consider that all methods on a List
will be used from all types of concurrency. Rather, I'd like to suggest that
perhaps a non-concurrent environment might use index methods to sort or
otherwise rearrange a list contents, and then publish this list into a
concurrent environment, to be consumed as a "work" queue or some other such
strickly end-to-end traversal/consumption.
The lifecycle of data structues in a concurrent environment is hardly ever
single phased. There are often multiple phases, and each phase can present
different requirements on the operation of the data structure right?
Gregg Wonderly
More information about the Concurrency-interest
mailing list