DeNova Safelock

Need a top software team for a short project?

We can help.

Even great teams like yours can't do everything. No one has infinite time or expertise.
Let's talk: services

Get instant safe concurrency with multithread, multiprocess, multiprogram locks.

Start as many threads, subprocesses, or programs as you like that all call your locked code. Safelock only lets one at a time run in a locked code block.


Safelock is free. Install it from PyPI:

        pip3 install safelock
to insure all dependencies are installed.

Quick start

Safelock is dependent on Safelog which was automatically installed with the above "pip3" command. You should start the safelog server first and then start the safelock server:


Or copy the safelock.service from the /usr/local/system to the /etc/systemd/system directory. Then you use the following commands to ensure your python apps can easily and safely be locked:

        systemctl enable safelock
        systemctl start safelock

How it Works

You get a simple python context manager.

from denova.os.lock import locked

with locked():
    ... your locked code ...

Locks are usually the simplest way to get safe concurrent access to a shared resource. But concurrency is a bear to get right. Safelock makes it easy.


Copyright 2019-2020 DeNova. Safelock is open source, licensed under GPLv3 .