Well, I know that Python uses references, so that wouldn't be possible in normal Python code without using stack inspection.

In RPython, which restricts all of that, it'd have to be another translator feature that uses magic to get things done.


On Fri, Feb 21, 2014 at 6:39 PM, Timothy Baldridge <tbaldridge@gmail.com> wrote:
It'd be nice to be able to do something like this in rpython:

compare_and_swap(foo.bar, oldval, newval) 

Or basically the cmpxchg. How hard would it be to get this in?

Timothy

--
“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
(Robert Firth)

_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev




--
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated."