Skip to main content

Threading and Multiprocessing for every project.

Project description

lox

https://img.shields.io/pypi/v/lox.svg https://travis-ci.com/BrianPugh/lox.svg?branch=master Documentation Status Updates

Threading made easy.

Installation

pip install lox

Features

  • Multithreading: Powerful, intuitive multithreading in just 2 additional lines of code.

  • Multiprocessing: Truly parallel function execution with the same interface as multithreading.

  • Synchronization: Advanced thread synchronization, communication, and resource management tools.

Usage

Easy Multithreading

>>> import lox
>>>
>>> @lox.thread(4) # Will operate with a maximum of 4 threads
... def foo(x,y):
...     return x*y
>>> foo(3,4)
12
>>> for i in range(5):
...     foo.scatter(i, i+1)
-ignore-
>>> # foo is currently being executed in 4 threads
>>> results = foo.gather() # block until results are ready
>>> print(results) # Results are in the same order as scatter() calls
[0, 2, 6, 12, 20]

History

0.3.3 (2019-06-19)

  • Fix bug where thread in scatter of lox.thread double releases on empty queue

0.3.2 (2019-06-17)

  • Fix manifest for installation from wheel

0.3.1 (2019-06-17)

  • Fix package on pypi

0.3.0 (2019-06-01)

  • Multiprocessing decorator. lox.pool renamed to lox.thread

  • Substantial pytest bug fixes

  • Documentation examples

  • timeout for RWLock

0.2.1 (2019-05-25)

  • Fix IndexSemaphore context manager

0.2.0 (2019-05-24)

  • Added QLock

  • Documentation syntax fixes

0.1.1 (2019-05-24)

  • CICD test

0.1.0 (2019-05-24)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lox-0.3.3.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

lox-0.3.3-py2.py3-none-any.whl (13.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file lox-0.3.3.tar.gz.

File metadata

  • Download URL: lox-0.3.3.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for lox-0.3.3.tar.gz
Algorithm Hash digest
SHA256 cc0577ce56452f82703670e79060f37221cf0a3df41c2a108856e3b6445486d3
MD5 ce5e34eaed5956cd667ef151ccb757c4
BLAKE2b-256 b1c001e1dd878cd5085df31325a70fd4d7aad3c2b1244438caa536aee62f3702

See more details on using hashes here.

File details

Details for the file lox-0.3.3-py2.py3-none-any.whl.

File metadata

  • Download URL: lox-0.3.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for lox-0.3.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bbb0a121464a0f98adef3bc732a89e497d567b2c4b03fe314d0c249f8ff3c40e
MD5 fffccd5a64052ef15b69bbdfc3650aca
BLAKE2b-256 a75f89ae13da4e7bab8c42d3e4b65e4fc1226f64ced1d4a2ca81cb79ef075e73

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page