Is there a lock-free & thread-safe data structure that implements IList?
Naturally by lock-free I mean an implementation that makes no use of locking primitives in .NET but rather uses interlocked operations / atomic operations to achieve thread safety... There isn't one, apparently under the concurrent data structures...
Has anyone seen one floating around?
I've seen a java one implemented in amino-cbbs, called LockFreeVector but nothing for .NET so far. Any ideas?
List<T>
is quite lock-free. You should also clarify what you mean by "lock-free". – LettielettishInsert
without locking (unless you allow spinning, I guess, since that isn't really the same as "locking"). But then, what do I know? – AspergesLockFreeVector<E>
is based does not have a randomInsert
operation (which is part of theIList<T>
interface). – Asperges