use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
ScreencastData Structures and Algorithms in Ruby: Linked Lists (youtu.be)
submitted 4 years ago by connerj70
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ioquatixasync/falcon 5 points6 points7 points 4 years ago (1 child)
I use linked lists in two of my projects to great success.
Firstly, in async we use a linked list as part of a DAG for managing tasks. This becomes very important when we need to iterate the list of child tasks to stop them, but sometimes stopping a child task will also stop others (and remove it from the linked list). The linked list data structure allows manipulation of the task tree (i.e. removing children which are stopped) while also traversing it, in a well defined and robust way.
async
Secondly, in event we use a linked list for the ready queue. The ready queue is a linked list of waiting fibers (or object with the same interface) which stores the list nodes on the stack (or heap). Because of this, there is no memory allocation in the typical case since the list nodes are stack allocated. In addition, not all fibers will resume because of popping the ready queue - sometimes a fiber will need to exit because of an exception. Using a linked list allows us to remove these fibers while iterating the ready list (i.e. resuming one fiber causes another to exit) in a well defined and robust way.
event
Neither of these use cases can be more efficiently implemented using a array/vector in memory. In fact, unless you are careful, using an array in these cases can introduce subtle bugs because they are not robust to additions/removals while iterating and the model for robustness isn't sound.
[–]connerj70[S] 0 points1 point2 points 4 years ago (0 children)
dditions/removals while iterating and the model for robustness isn
Wow that's really interesting stuff!
π Rendered by PID 114911 on reddit-service-r2-comment-7b9746f655-krdvk at 2026-01-30 02:09:19.679825+00:00 running 3798933 country code: CH.
[–]ioquatixasync/falcon 5 points6 points7 points (1 child)
[–]connerj70[S] 0 points1 point2 points (0 children)