Skip to main content

Thread related convenience classes and functions.

Class AdjustableSemaphore

A semaphore whose value may be tuned after instantiation.

Function bg(func, daemon=None, name=None)

Dispatch the callable func in its own Thread; return the Thread.

Parameters: daemon: optional argument specifying the .daemon attribute. name: optional argument specifying the Thread name.

Class LockableMixin

Trite mixin to control access to an object via its ._lock attribute. Exposes the ._lock as the property .lock. Presents a context manager interface for obtaining an object's lock.

Function locked(func)

A decorator for monitor functions that must run within a lock. Relies upon a ._lock attribute for locking.

Function locked_property(func, lock_name='_lock', prop_name=None, unset_object=None)

A thread safe property whose value is cached. The lock is taken if the value needs to computed.

Function via(cmanager, func, *a, **kw)

Return a callable that calls the supplied func inside a with statement using the context manager cmanager. This intended use case is aimed at deferred function calls.

Class WorkerThreadPool

MRO: cs.resources.MultiOpenMixin, cs.obj.O
A pool of worker threads to run functions.

Class WTPoolEntry

MRO: builtins.tuple
WTPoolEntry(thread, queue)

Download files

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

Source Distribution

cs.threads-20190102.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file cs.threads-20190102.tar.gz.

File metadata

  • Download URL: cs.threads-20190102.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.6.6

File hashes

Hashes for cs.threads-20190102.tar.gz
Algorithm Hash digest
SHA256 e6b8b21d63b7fd1a7749cbb3efd3c049092fcbc831454cbb7b95573e3dc977ee
MD5 258c63e7236ab9057a9e553ab181ddd7
BLAKE2b-256 6fce6decb7a1ca1f4dbb4ffe0ffd5c1611a702f6cc92b5a2ea81f999a4514114

See more details on using hashes here.

Release history Release notifications | RSS feed

20260610

2 files

20260531

2 files

20260530

2 files

20260526

2 files

20250528

2 files

20250325

2 files

20250306

2 files

20241005

2 files

20240630

2 files

20240422

2 files

20240412

2 files

20240316

2 files

20240303

2 files

20231129

2 files

20230331

2 files

20230212

2 files

20230125

2 files

20221228

2 files

20221207

2 files

20221118

2 files

20211208

1 file

20210306

1 file

20210123

1 file

20201025

1 file

20200718

1 file

20200521

1 file

20191102

1 file

20190923.2

1 file

20190923.1

1 file

20190923

1 file

20190812

1 file

20190729

1 file

20190422

1 file

This release

20190102 This release

1 file

20160828

1 file

20160827

1 file

20150115

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page