Trying to understand how FuturesUnordered works. Getting tripped up with how the ready_to_run_queue
interacts with linked list. Specifically, confused by pending_next_all
, spin_next_all
, link
, and unlink
. Does anyone have a good reference as to how this works? Specific questions include:
-
The docs mention under heavy thread contention, a compare-exchange loop could become costly. What does thread contention mean here?
-
How does using
stub
resolve this? Confused as to how usingpending_next_all
allowsnext_all
as needed for iterator. When will there be a case where head_all -> stub -> next? -
More generally, would love an explanation about how
ready_to_run_queue
works withhead_all
,next_all
pointers andstub
. Particularly for the impl Stream block