Thread synchronization utilities for Python.
from cereggii import AtomicDict, ThreadSet
counter = AtomicDict({"red": 42, "green": 3, "blue": 14})
@ThreadSet.repeat(10) # create 10 threads
def workers():
counter.reduce_count(["red"] * 60 + ["green"] * 7 + ["blue"] * 30)
workers.start_and_join()
assert counter["red"] == 642
assert counter["green"] == 73
assert counter["blue"] == 314The recommended installation method is to download binary wheels from PyPI:
pip install cereggiiuv add cereggiiTo install from source, first pull the repository:
git clone https://github.com/dpdani/cereggiiThen, install the build requirements (do this in a virtualenv):
pip install -e ".[dev]"Finally, run the tests:
pytestApache License 2.0. See the LICENSE file.
- Documentation: https://dpdani.github.io/cereggii/
- Source: https://github.com/dpdani/cereggii
- Issues: https://github.com/dpdani/cereggii/issues
The Peniocereus Greggii (also known as Cereus Greggii) is a flower native to Arizona, New Mexico, Texas, and some parts of northern Mexico.
This flower blooms just one summer night every year and in any given area, all these flowers bloom in synchrony.
Image credits: Patrick Alexander, Peniocereus greggii var. greggii, south of Cooke's Range, Luna County, New Mexico, 10 May 2018, CC0. source