Exemplo n.º 1
0
    def fast_blacklisted(x, y=None):
        # The task should observe a certain computation time such that we can
        # ensure that it is not stolen due to the blacklisting. If it is too
        # fast, the standard mechansim shouldn't allow stealing
        import time

        time.sleep(0.01)
Exemplo n.º 2
0
            def access_limited(val, sem):
                import time

                with sem:
                    assert len(protected_resource) == 0
                    protected_resource.append(val)
                    # Interact with the DB
                    time.sleep(0.2)
                    protected_resource.remove(val)
Exemplo n.º 3
0
    def __reduce__(self):
        import time

        time.sleep(self.delay)
        return (SlowTransmitData, (self.delay, ))
Exemplo n.º 4
0
 def increment(self):
     time.sleep(0.1)
     self.n += 1
     return self.n
Exemplo n.º 5
0
    def __setstate__(self, state):
        delay = state
        import time

        time.sleep(delay)
        return SlowDeserialize(delay)