deephaven.ugp

This module provides access to the Update Graph Processor(UGP)’s locks that must be acquired to perform certain table operations. When working with refreshing tables, UGP locks must be held in order to have a consistent view of the data between table operations.

auto_locking = False

Whether to automatically acquire the Update Graph Processor(UGP) shared lock for an unsafe operation on a ticking table when the current thread doesn’t own either the UGP shared or the UGP exclusive lock. The newly obtained lock will be released after the table operation finishes.

auto_locking_ctx(*args, **kwargs)[source]

An auto-locking aware context manager. It ensures that the enclosed code block runs under the UGP shared lock if ugp.auto_locking is True, the target table-like object or any table-like arguments are refreshing, and the current thread doesn’t own any UGP locks.

auto_locking_op(f)[source]

A decorator for annotating unsafe Table operations. It ensures that the decorated function runs under the UGP shared lock if ugp.auto_locking is True, the target table-like object or any table-like arguments are refreshing, and the current thread doesn’t own any UGP locks.

Return type

Callable

exclusive_lock()[source]

Context manager for running a block of code under a Update Graph Processor(UGP) exclusive lock.

exclusive_locked(f)[source]

A decorator that ensures the decorated function be called under the Update Graph Processor(UGP) exclusive lock. The lock is released after the function returns regardless of what happens inside the function.

Return type

Callable

has_exclusive_lock()[source]

Checks if the current thread is holding the Update Graph Processor(UGP) exclusive lock.

Return type

bool

has_shared_lock()[source]

Checks if the current thread is holding the Update Graph Processor(UGP) shared lock.

Return type

bool

shared_lock()[source]

Context manager for running a block of code under a Update Graph Processor(UGP) shared lock.

shared_locked(f)[source]

A decorator that ensures the decorated function be called under the Update Graph Processor(UGP) shared lock. The lock is released after the function returns regardless of what happens inside the function.

Return type

Callable