[Python-ideas] Thread IPC idea: Quipe? Sockqueue? (Re: Python and Concurrency)

Ron Adam rrr at ronadam.com
Sun Apr 1 08:14:10 CEST 2007

Jim Jewett wrote:
 > On 3/29/07, Ron Adam <rrr at ronadam.com> wrote:
 >> Jim Jewett wrote:
 >> > What we really need is a Task object that treats shared memory
 >> > (perhaps with a small list of specified exceptions) as immutable.
 >> * A 'better' task object for easily creating tasks.
 >>       + We have a threading object now. (Needs improving.)
 > But the task isn't in any way restricted.  Brett's security sandbox
 > might be a useful starting point, if it is fast enough.  Otherwise,
 > we'll probably need to stick with microthreading to get things small
 > enough to contain.
 >> * Shared memory -
 >>       + Prevent names from being rebound
 >>       + Prevent objects from being altered
 > I had thought of the names as being part of a shared dictionary.  (Of
 > course, immutable dictionaries aren't really available out-of-the-box
 > now, and I'm not sure I would trust the supposed immutability of
 > anything that wasn't proxied.)

Not all that different. The immutable dictionary would be an implantation 
detail of a locked name space I think.

I'm wondering if there might be a way to have an inheritance by container 
relationship, where certain characteristics can be acquired from parent 
containers.  Not exactly the same as class inheritance.

 >>      frozen: object can't be altered while frozen
 >>      locked: name can't be rebound to another object
 >>      3. Pass mutable "deep" copies back and forth.
 >>            ? Works now. (but not for all objects?)
 > Well, anything that can be deep-copied -- unless you also want the
 > mutations to be collected back into a single location.

It would need to be able to make a round trip.

 >>      4. Pass frozen mutable objects.
 >>            - Needs freezable/unfreezable mutable objects.
 >>              (Not the same as making an immutable copy.)
 > And there is where it starts to fall apart.  Though if you look at the
 > pypy dict and interpreter optimizations, they have started to deal
 > with it through versioning types.

I didn't find anything about "versioning" at these links. Did I miss it?


 > http://codespeak.net/pypy/dist/pypy/doc/interpreter-optimizations.html#id23


More information about the Python-ideas mailing list