[Twisted-Python] How to force synchronous behavior
glyph at divmod.com
glyph at divmod.com
Sun Oct 30 01:31:42 EST 2005
On Sat, 29 Oct 2005 22:33:30 +0100, Michael <ms at cerenity.org> wrote:
>Out of interest, what's your opinion on what we're doing with communicating
>generators in the project beginning with a "K" (*) ? As far as I'm concerned
>we're pretty much doing the same sorts of things as twisted, just written
>very differently. However, there are similarities in the way we write things
>to some of the ideas raised in this thread, and if you think we're doing
>something dumb (as opposed to ideas that could be ripped out at somepoint
>*IF* they prove useful), I'd be interested to hear (one of these days I'll
>learn to speak English properly as well).
It's not so much that "K" is doing something dumb (for reference: we are not talking about the successor to J, which is itself a successor to APL). With a project like "K", there would be as much focus on explaining correct usage of generators as there is in Twisted focusing on correct usage of Deferreds. It would be hard to write a program using "K" and not understand the ramifications of what you're doing.
>I suppose one risk point of our approach is that by trying to make it easier
>to work with we risk people thinking concurrency is naturally is easy (which
>is potentially quite a dangerous meme, since software concurrency isn't
>naturally easy). BTW, FWIW, I read the blog post you pointed at earlier in
>the thread and agree with it).
I looked at "K". Reading code in it was powerfully weird - and this is coming from the author of Twisted ;-). It was enough like Erlang that it would only make things easy for experts, so I don't think that it would lead to this problem - on the other hand, I haven't seen how large communities react to it.
>I'll say one thing though, hopefully the original poster realises how much
>they have to do to make their code safe when they're faking synchronous
>behaviour and faking a single process look. If they don't then as everyone
>has said, they're setting themselves up for a world of pain.
I have a lot of experience dealing with people that ask questions in the form that the poster did. As a rule they don't have any idea how hard solving concurrency problems is, and have been lead to believe (by Java or whatever) that concurrency is easy, just a matter of running 2 or more "simple" synchronous (-looking) programs at a time. While I don't know the OP personally, I am willing to risk their taking offense, so that I can continue to drive home the point to hordes of fledgeling developers out there that seem to desperately want to believe that massively concurrent programming is easy.
More information about the Twisted-Python