Re-hi,

I'm asking because I can think of another rather different approach,
which would be more in-line with pypy-stm's ultimate goals.  Your
module is defining a database-like structure that works like an
in-memory key-value store -- some kind of generalized dictionary.  So
the "hard" question, from the point of view of STM, is what occurs if
user code runs transactions that each want to access or modify
different keys.

In other words, what if there are multiple threads that all run in a
"with atomic" statement, and that try to change different keys of the
same database?  What we would like to occur is that the multiple
threads all succeed; what is likely to occur instead is that most of
them will conflict and rollback.  But it's probably possible to
redesign the internals of the database to avoid this, at least most of
the time.

How to do this exactly is not clear, and depends on the context.
Also, we could argue that it would be great if regular python
dictionaries had this property too: writing or accessing different
keys should not cause a transaction to rollback (which comes with a
few hard questions like what to do with __eq__/__hash__).


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to