Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
otabdeveloper4
· 3y ago · 0 comments
Linked lists are necessary when you have structures that can't be moved. Very important in a highly concurrent or lockfree environment.
Comments
[–]
iudqnolq
3y ago
How could you use the
Rust standard library's
linked list for that?
[–]
KerrAvon
3y ago
A deque will usually work just as well in that environment and it will always have better general performance characteristics. There are very few legitimate uses of linked lists.
[–]
otabdeveloper4
OP
3y ago
A deque is a doubly-linked list under the hood.
[–]
adgjlsfhk1
3y ago
Array based deques are very common (and usually much faster). Doubly linked lists are absolutely awful for memory locality.
[–]
boxed
3y ago
Can't you have a list of pointers instead?
[–]
xgstation
3y ago
Resizing/deleting items in list in most implementations are either not lock free or not threadsafe
[–]
chmod775
3y ago
Yeah, but what if you just use smaller lists and point to the next/previous list?
Hold on...
[–]
boxed
3y ago
Linked lists aren't either so....?