Overview

The Solidity Gateway to Arcology Concurrency Control

Solidity, the programming language used to develop smart contracts on the Ethereum platform, isn't designed for concurrent use, so it does not include the features and capabilities necessary for efficient concurrent programming.

Arcology offers a suite of Solidity APIs customized for concurrent programming tasks. The tools and data structures in the suite are the doorways to fully harness the power of Arcology's parallel execution design.

All Arcology's concurrent tools are not only thread-safe but also always deterministic by design. This means that the behavior and outcomes of operations on these data structures are guaranteed to be predictable and consistent, regardless of the order or timing of concurrent access.

Note: The packages in the guide are not meant for production deployment but rather experimental for now. Developers are encouraged to explore and learn from the code while emphasizing collaboration and feedback to improve the platform.

What Is Parallelization

In Arcology, contract parallelization is a process of replacing the shared variables and data structures having shared state with

in the smart contract development so that multiple transactions can be processed simultaneously by taking full advantage of Arcology Network's parallel execution power. To achieve this goal, the suite provides a set of

What Is in the Suite

To achieve this goal, the suite provides the following components to achieve the goal:

Concurrent Data Structures

  • 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.

  • 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, as long as the variables have been read by any one of them.

  • Base Container: A hybrid concurrent data structure combining the functionalities of standard maps and arrays, functioning as a map set behind the scenes. Serving as the foundation for all other concurrent containers on Arcology, users can always construct custom data structures through inheritance.

Tools

  • Multiprocessing: multiprocessing feature enables developers to write code that can handle multiple tasks by leveraging parallel processing capabilities, similar to using multiple threads in general-purpose languages.

  • Runtime: The package provides runtime information to developers.

  • Storage: This package contains utilities for cost-effective data storage within smart contracts.

Examples

The section includes several examples aimed at aiding your comprehension of the utility of the functions and tools provided.

Benchmark

The Benchmark section comprises a collection of benchmarking examples designed to showcase the performance of contracts within Arcology's parallelized execution environment.

Contribution

Please feel free to contact us if you would like to contribute your own examples.

Last updated