yokome.util.concurrency

class yokome.util.concurrency.MemoryLock(sleep, request)

Context manager for memory reservation.

This does not lock the physical memory, but is only intended as a means of communication for multiple asynchronous tasks that jointly require more memory than the system is expected to be able to provide.

Locking is solely based on the total size of the system memory and the explicitly requested memory size on entering the context manager.

class yokome.util.concurrency.SubprocessLock(sleep)

Context manager limiting the number of parallel processes.