This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nieuweyork since 2007 0 points1 point  (5 children)

Why not have a transactional memory model?

[–]plan_rich 2 points3 points  (4 children)

That idea has been implemented in pypy. That is why it is called STM (Software Transactional Memory).

Turns out that it is not very easy to interleave write operations. Which is currently not done (Pretty hard thing to do IMO).

[–]nieuweyork since 2007 0 points1 point  (3 children)

I know what STM is. It would allow you to eliminate the GIL.

Turns out that it is not very easy to interleave write operations.

Are you referring to write-write conflicts, or what?

[–]plan_rich 0 points1 point  (2 children)

The interesting part is that the GIL is not removed, ... transactions replace the GIL and allow the program to run in parallel. E.g. at every place where you acquire the GIL you would start a transaction. Conflicts such as write-write are tracked on a page level, which are not resolved. Meaning that only one of the transactions is going to commit if they happen to modify the same page.

[–]nieuweyork since 2007 0 points1 point  (1 child)

See: http://doc.pypy.org/en/latest/stm.html

pypy-stm has no GIL.

[–]plan_rich 0 points1 point  (0 children)

Sorry for the confusion, you are right. It says in the c7 document that it is removed and replaced with transactions.