Re:Ian Bicking: My Unsolicited Advice For PyPy
by ianb on Monday April 04, 2011 @06:40PM
(#2408880)
Generally cooperative multitasking systems like these (anything based on greenlets, I think) mean that you are running concurrent tasks in a single process, with a single set of shared data. It's basically the same as threads, only you can't have multiple tasks literally accessing the same data at the same time (though with the GIL I guess technically that's true with threads too ;).
[ Parent
| on HN ]
Re:Ian Bicking: My Unsolicited Advice For PyPy
by jamwt on Monday April 04, 2011 @07:32PM
(#2409037)
Well, it's only shared if you share it!
I guess it boils down to "don't use mutable globals". That's as true in threaded environments as it is in async ones.
If your requirement is that there must be system-enforced safety rather than safe practices and idioms, I'd say Python isn't the right tool (Haskell is) to begin with. As you know, Python is all about practices, idioms, and discipline.
Re:Ian Bicking: My Unsolicited Advice For PyPy
by euccastro on Monday April 04, 2011 @07:03PM
(#2408952)
Just don't access the same data? Threads, greenlets, tasklets, etc. allow you to share state, but don't force you to.
Greenlets/tasklets are game changing with respect to OS threads not because they introduce new ways of working, but because their performance and scalability afford you ways of working that would be theoretically possible but impractical with threads. The GIL only widens that gap.