Hacker News new | past | comments | ask | show | jobs | submit login

Linked lists are necessary when you have structures that can't be moved. Very important in a highly concurrent or lockfree environment.



How could you use the Rust standard library's linked list for that?


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.


A deque is a doubly-linked list under the hood.


Array based deques are very common (and usually much faster). Doubly linked lists are absolutely awful for memory locality.


Can't you have a list of pointers instead?


Resizing/deleting items in list in most implementations are either not lock free or not threadsafe


Yeah, but what if you just use smaller lists and point to the next/previous list?

Hold on...


Linked lists aren't either so....?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: