问题
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:
But I do not understand the metaphor used by Christopher Kohlhoff, do you ?
回答1:
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
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).
来源:https://stackoverflow.com/questions/28669840/in-the-context-of-boostasio-what-is-the-metaphor-behind-the-term-strand