How to use the simgrid.this_actor.suspend function in simgrid

To help you get started, we’ve selected a few simgrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simgrid / simgrid / examples / python / actor-kill / View on Github external
def victim_a_fun():
    this_actor.on_exit(lambda:"I have been killed!"))"Hello!")"Suspending myself")
    this_actor.suspend()                        # - Start by suspending itself
    # - Then is resumed and start to execute a task"OK, OK. Let's work")
    # - But will never reach the end of it"Bye!")
github simgrid / simgrid / examples / python / actor-suspend / View on Github external
def lazy_guy():
    """The Lazy guy only wants to sleep, but can be awaken by the dream_master process""""Nobody's watching me ? Let's go to sleep.")
    this_actor.suspend()  # - Start by suspending itself"Uuuh ? Did somebody call me ?")

    # - Then repetitively go to sleep, but get awaken"Going to sleep...")
    this_actor.sleep_for(10)"Mmm... waking up.")"Going to sleep one more time (for 10 sec)...")
    this_actor.sleep_for(10)"Waking up once for all!")"Ok, let's do some work, then (for 10 sec on Boivin).")
    this_actor.execute(980.95e6)"Mmmh, I'm done now. Goodbye.")