Hacker News new | ask | show | jobs
by makmanalp 4099 days ago
> It is a Python in which you can do minor tweaks to your existing, non-multithreaded programs and get them to use multiple cores. You identify medium- or large-sized, likely-independent parts of the code and to ask PyPy-STM to run these parts in parallel. An example would be every iteration of some outermost loop over all items of a dictionary.

This is very neat! Obviously it's not a magic drop-in, but still.

Relevant bit from the docs: http://pypy.readthedocs.org/en/latest/stm.html#transaction-t...

1 comments

The main point is that at first, your code will be slow (as in bound to a single core) and then you can optimize it to provide better performance. This is as opposed to threads, where your code will be immediately fast, but buggy. The difference comes from the fact that 90% correct is still buggy, but 90% paralellizable is kinda good.
Is there a transaction module that provides a null/no-op implementation for compatibility with CPython?
yes, normal transaction.py should just work :-)