Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In the context of boost::asio, what is the metaphor behind the term "strand"?

Tags:

boost-asio

As a French native, and a boost::asio user, I have added the 'strand' word to my vocabulary (is a 'toron' in French), here an image of a rope made of three strands, an each one made of multiple others:
enter image description here
But I do not understand the metaphor used by Christopher Kohlhoff, do you ?

like image 849
Jean Davy Avatar asked Oct 18 '25 16:10

Jean Davy


1 Answers

A strand is a logical, sequential path.

Even if many paths intertwine, the paths are continuous and unbroken, and logically distinct.

This is what makes the metaphor work: even though many strands can be intertwined (on many threads, even), the "logical path of code" is never broken, interrupted or collided with another strand

enter image description here

Actually the picture in the question is pretty descriptive and more typical than this, because indeed you will have a limited number of strands doing - typically - similar work in a single direction (forward in time) and in fair alternation (io_service is responsible for scheduling tasks for each strand).

like image 181
sehe Avatar answered Oct 22 '25 05:10

sehe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!