Why Concurrent Library
The Solidity Gateway to Arcology Concurrency Control
Arcology is 100% EVM-compatible. Developers can redeploy their applications without modification. So why introduce a concurrent library? The answer is efficiency.
Arcology has a parallel execution engine. But most Ethereum contracts were designed for sequential execution. While they run seamlessly on Arcology, in many cases, they won’t reach maximum efficiency unless built with our concurrent library — which is design to remove contention from the contract code completely.
What Are in the Suite
The suite is designed with this concept in mind, providing the following components to efficiently handle concurrent state modifications without locking or contention.
Concurrent Data Structures
Arcology's concurrent data structures can be considered a form of blockchain-specific Conflict-Free Replicated Data Types (CRDTs) designed to enable efficient and conflict-free updates.
Cumulative Variables: A commutative variable can receive concurrent delta updates from multiple transactions, and the final result consistently remains the same, irrespective of the order in which the updates are processed.
Concurrent Arrays: Merging thread-safe design with determinism to facilitate efficient parallel processing in multi-threaded environments. Resembling a conventional array, it permits concurrent push-back operations to the container and supports random reads, as long as they don't target the same elements.
Concurrent Maps: Data structures combining the function of standard maps and arrays. A concurrent map differentiates itself from native mapping by providing the ability to iterate its keys and values deterministically.
Custom Data structures: In addition, users can build the concurrent data structures of their choice based on the built-in ones provided by Arcology.
Tools
Multiprocessing: spawn EVM instances programmatically with controlled depth and instance limits, similar to using multiple threads in general-purpose languages.
Runtime: The package provides runtime information to developers, enabling Arcology to execute their transitions more effectively.
Contribution
Please feel free to contact us if you would like to contribute your own examples.
Last updated