Re: [pypy-dev] slow-ish multithreaded primitives

2014-02-21 Thread Armin Rigo
Hi Dima, On 21 February 2014 15:43, Dima Tisnek wrote: > sorry I don't have code handy, it's part of a larger project, but if > someone's interested, please reply and I'll hack up a short test case. Please do. Armin ___ pypy-dev mailing list pypy-dev

Re: [pypy-dev] Debugging Blocked Block exceptions

2014-02-21 Thread Armin Rigo
Hi Timothy, On 21 February 2014 15:45, Timothy Baldridge wrote: > In an interpreter I'm writing I'm often running into Blocked block > exceptions. I've been able to solve several of these errors but the problem > is always figuring out what exactly I've done to cause the error. Most of > the time

Re: [pypy-dev] Easy way to get access to cmpxchg?

2014-02-21 Thread Armin Rigo
Hi Timothy, On 22 February 2014 01:39, Timothy Baldridge wrote: > compare_and_swap(foo.bar, oldval, newval) At some point we added a way to do it (basically you can do it yourself, by writing a one-line function in C and calling it). We no longer do that: it's too much of a mess if you start ha

Re: [pypy-dev] Easy way to get access to cmpxchg?

2014-02-21 Thread Ryan Gonzalez
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

[pypy-dev] Easy way to get access to cmpxchg?

2014-02-21 Thread Timothy Baldridge
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

[pypy-dev] Debugging Blocked Block exceptions

2014-02-21 Thread Timothy Baldridge
In an interpreter I'm writing I'm often running into Blocked block exceptions. I've been able to solve several of these errors but the problem is always figuring out what exactly I've done to cause the error. Most of the time it seems to come down to some sort of missing assertions that cause the t

[pypy-dev] slow-ish multithreaded primitives

2014-02-21 Thread Dima Tisnek
Hey all, I wrote some threaded code and ran it under different version of python, and unexpectedly high overhead is observed: cpython 2.6.8. cpython 2.7.6, pypy 2.2.1: 14~53ms cpython 3.3.4: pypy 2.1.0 beta py3 mode: <1ms is someone here interested in getting to the bottom of it? or getting pypy