Hi, 2011/3/15 Timothy Baldridge <tbaldri...@gmail.com>: > Basically cas takes the value you think var currently has, the value > you want var to be, and the var. Cas then updates var if and only if > var's current value == oldvar. But cas is atomic. So basically it > returns false if the cas failed, and true if it worked. Using cas you > can build mutexes, shared objects, etc.
In pypy/module/thread/ll_thread.py, allocate_lock() creates a Lock object, similar to the Python's thread.Lock. Careful though with threads: most of PyPy's garbage collectors are not thread-safe. -- Amaury Forgeot d'Arc _______________________________________________ pypy-dev@codespeak.net http://codespeak.net/mailman/listinfo/pypy-dev