matplotlib

This Page

simx.processmgr module

class simx.processmgr.ProcStatus
class simx.processmgr.ProcessManager(name, entity, service_input)

Bases: simx.core.core.PyService

The process manager is the work-horse for proces oriented simulation in SimX. All process switching, scheduling and management goes via the process manager. The process manager is a service that lives on the controller entity

get_gr_process(grlt)

Returns the process object associated with a greenlet.

get_proc_greenlet(process)

Returns a greenlet associated with a process

get_proc_status(process)

Returns process status

proc_activate(proc_info)

Creates the greenlet that will run the process and switches to the process

proc_add_child(parent, child)

Adds entry for child process in process table entry of parent

proc_deactivate(proc_info)
proc_kill(proc)

kills associated greenlet object and de-activates process

proc_kill_all(proc)

Kills process and all of its sub processes. This calls proc_kill_all recursively for all its children and calls kill for leaf processes.

proc_new(proc, parent=None, waitingon=None)

Creates a new process table entry for process

proc_remove_child(parent, child)

Removes entry for child process in process table entry of parent

proc_schedule(process, delay=1, parent=None, waitingon=None)

Schedules a process to get executed after time given by delay The default delay is the value of local_min_delay (1 time unit)

proc_sleep(proc, duration=None, switch=True)

Puts a process to sleep for time units specified by duration. If no duration is specified, process is put to sleep indefinitely till woken up by the main thread

proc_switch(proc_info)
proc_waitfor(p1, p2)

Suspends process p1 till p2 finishes execution

proc_waiton(proc, resource)
recv(msg)
recv_activate(msg)
recv_wakeup(msg)
send_to_self(msg, delay)

Sends a message to self with given delay

simx.processmgr.get_current_process()

Called from within the execution frame of a Process. Returns the current active process.

simx.processmgr.get_process_mgr()

A helper function that returns the handle of the process manager service

simx.processmgr.schedule_process(process, delay=1)

Invokes ProcessManager.proc_schedule()