hadrieng2 / async-ops Goto Github PK
View Code? Open in Web Editor NEWExploring standard abstractions for asynchronous operations
Exploring standard abstractions for asynchronous operations
Sometimes, the server carrying out asynchronous work is actually located on a remote machine, accessible over a network. This usage scenario should be considered as an extreme variant of the IPC scenario of #4, where each of the concerns outlined there is exacerbated. In addition, other specific challenges emerge:
The current inline callback executor has many issues, and is only suitable for special cases. As a common case, I would ultimately like callbacks to be processed asynchronously by a CPU-sized pool of threads, rather than synchronously by the single unlucky and arbitrarily selected thread who happens to have propagated a server status update to the client.
In this TBB-like design, it is desirable to use work-stealing dequeues in order to improve the scalability to many-core CPUs. At the same time, and unlike in TBB, deterministic work-stealing algorithms (rather than random selection) should be used in order to enable efficient CPU usage when no task is being processed.
Some libraries such as Tokio use a coroutine-based model for asynchronous operations, where some monitoring code is executed on demand whenever the status of an asynchronous operation is polled or synchronized with. We should probably provide a backend which is compatible with this.
Sometimes, it makes sense to implement the client and the server of an asynchronous operation in different OS processes. Although shared-memory communication can still easily be used, the interprocess communication setting still has a number of unique points that should be carefully considered:
People are not going to use yet another abstraction if it's not fast enough. I really need to measure the performance of this library, profile, determine what's slow and improve upon it.
Every modern computer comes with a little GPU supercomputer inside. Given a little bit of hardware-specific driver setup, one can command all of these using a consistent asynchronous API, OpenCL. I should explore ways to interface this API in a consistent way.
Once we have threaded asynchronous operations, an obvious thing to do is to start implementing user threading on top of a finite thread pool, like HPX and Intel TBB in the C++ world. Need to explore which libraries already exist for this purpose and how much they would fit our needs. Code should probably be heavily shared with #1 .
An asynchronous API is not complete without proper IO support. For networked IO, we will probably want to use Tokio, which will require #3. For file IO, I still need to check which good libraries exist in Rust.
Clients often want to interact with sets of asynchronous operations, by waiting for the status of one or all of them to change in some way. We should provide a way to achieve this goal through something like the when_any/when_all future combinators of the C++ concurrency TS.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.