dragon.mpbridge.process

Dragon’s replacement classes for Multiprocessing Process.

Classes

DragonPopen

Dragon's class to spawn/open a new process.

DragonPopenStub

This Popen class replaces the actual DragonPopen in process objects returned to a child process by e.g. mp.current_process().

DragonProcess

Dragon's Process uses most of the base process implementation.

PUID

The purpose of this class is to use where such things like a fd (sentinel) and PID are found

class PUID

Bases: int

The purpose of this class is to use where such things like a fd (sentinel) and PID are found

thread_wait(timeout, done_ev, ready)

utility function for wait implementation

Parameters:
  • timeout (_type_) – _description_

  • done_ev (_type_) – _description_

  • ready (_type_) – _description_

class DragonPopen

Bases: Popen

Dragon’s class to spawn/open a new process.

method = 'dragon'
poll(flag=1)
wait(timeout=None)
class DragonProcess

Bases: BaseProcess

Dragon’s Process uses most of the base process implementation.

property ident: int

Property method uniquely identifying the process.

Returns:

The p_uid of this process, None if it has not been started.

Return type:

int

property pid: int

Property method uniquely identifying the process.

Returns:

The p_uid of this process, None if it has not been started.

Return type:

int

class DragonPopenStub

Bases: object

This Popen class replaces the actual DragonPopen in process objects returned to a child process by e.g. mp.current_process(). The parent will see the correct DragonPopen class, as they have actually started the child. This class only contains what is necessary to make the process object work for the child with Multiprocessings internal methods that we have not modified.

__init__(p_uid)
poll(flag=1)

So we can show the correct exitcode when printing a process object returned by mp.current_process()