async-taskcrate: It is one of the most complicated crates in thesmolecosystem and is just a future on the heap. It predatessmoland was originally used as the task implementation forasync-std.smolpackage: The author prides himself on makingsmolpackages easy to parse for beginners.futures-litecrate: Used to run two futures at the same time easily by using thezipcombinator andblock_on.- Scalability solutions: The
zipcombinator has limitations for higher-level scenarios. Theslabcrate is used to fit futures and boxedFutureto use multiple implementors. AGiantZipstruct is created to poll multiple futures at once. But it has problems like being inefficient and unfair. - Queue structure: A queue structure is added to the
GiantZipto solve theO(n)problem and the fairness problem. The queue contains the indexes of the futures that are ready to be woken. Thepollimplementation is adjusted to pop from the queue instead of polling each future. - Persistent problems: There are inefficiencies in the current implementation like three main allocations (a
Vec, aBoxfor each future, and aWaker). There are also issues like usingusizeas an index, not being able to get the result of a future, and difficulty in removing a running future. These problems will be addressed in the next blog post when building a real task abstraction.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用。你还可以使用@来通知其他用户。