A green threading library with true concurrency for Python
31–40 of 40 posts
Re: A green threading library with true concurrency for Python
#32> Conpig threads still can only run on one core of a processor. The disillusionment caused by having so many options for non-parallel "concurrency" in Python is, I believe, feeding the high defection rate from Python to Go.
Different kind of user, but... just sayin
Re: A green threading library with true concurrency for Python
#33Re: A green threading library with true concurrency for Python
#34Earlier quoted context omitted.
With a cooperative scheduler, you will , sooner or later, experience some form of starvation. The most obvious is the process that just infinitely loops, but less obvious situations will end up popping up too; calls that you thought were handled by the event loop but turn out to be blocking and add up when you start calling them at scale, strange behavior when you have a set of processes that turn out to yield far le…
It sounds like this sort of problem comes from using a cooperative scheduler to implement concurrency of arbitrary routines rather than control flow. I haven't been in a situation in which it would even be possible for something to yield less often than I expect, because I expect it to run until it yields. Similarly I don't often find that subroutines return too infrequently because I expect them to run until they re…
Re: A green threading library with true concurrency for Python
#35Earlier quoted context omitted.
It sounds like this sort of problem comes from using a cooperative scheduler to implement concurrency of arbitrary routines rather than control flow. I haven't been in a situation in which it would even be possible for something to yield less often than I expect, because I expect it to run until it yields. Similarly I don't often find that subroutines return too infrequently because I expect them to run until they re…
You will eventually, at scale, be wrong about that. To have full and correct knowledge of exactly how long your code takes to run sufficient to do this sort of scheduling correctly, by hand, in advance of running it, is basically equivalent to claiming that you never need to profile code because you already know exactly how long it takes. And it is well known and established to my satisfaction that even absolute, tot…
I'm not sure why it is difficult to do this sort of thing correctly. The scheduler does next to nothing in the "server with connections managed in coroutines" case and probably makes matters worse in the "storing game state in execution states" case. It could have a positive impact in the server application if one routine is secretly going to crash or run forever, in the sense that the other routines will continue running while the problematic feature is fenced off or fixed.
Re: A green threading library with true concurrency for Python
#36Earlier quoted context omitted.
This may help explain the difference: http://blog.golang.org/concurrency-is-not-parallelism
Should I have thrown a literally in there? Literally Concurrent means at the same time. Parallel literally means non intersecting. I understand some dumbass has\is trying to co opt the language it doesn't mean I have to like it. If one of them should mean one thing and the other the other why not have the one that literally means at the same time for the term that means at the same time. And have the one that means n…
That's called a lingo or a jargon (in this case, programmer lingo), and it involves making up words or having a different definition for a given word in the correct context.
Re: A green threading library with true concurrency for Python
#37> Conpig threads still can only run on one core of a processor. The disillusionment caused by having so many options for non-parallel "concurrency" in Python is, I believe, feeding the high defection rate from Python to Go.
And the numpy/scipy/ipython notebook/scikit-learn axis is driving a lot of python adoption these days. Look in any blog about beginning data mining/machine learning, odds are it'll say learn python or R. Different kind of user, but... just sayin
Re: A green threading library with true concurrency for Python
#38I don't really get what advantage this gives me beyond using gevent. There's still no parallelism. The readme describes it as "A solution to concurrency," but I already get that using gevent. Is it just to improve communication between green threads?
It basically is 50 lines of code that implement some stuff from gevent... So yes, it's more of a joke I guess.
http://hackage.haskell.org/packages/archive/forkable-monad/0...
Also, this doesn't implement some stuff from gevent, it implements some stuff over and using gevent.
Re: A green threading library with true concurrency for Python
#39Earlier quoted context omitted.
It basically is 50 lines of code that implement some stuff from gevent... So yes, it's more of a joke I guess.
So number of lines of code makes a library a joke? One of the most commonly used Haskell libraries is only 25. http://hackage.haskell.org/packages/archive/forkable-monad/0... Also, this doesn't implement some stuff from gevent, it implements some stuff over and using gevent.
Re: A green threading library with true concurrency for Python
#40Earlier quoted context omitted.
So number of lines of code makes a library a joke? One of the most commonly used Haskell libraries is only 25. http://hackage.haskell.org/packages/archive/forkable-monad/0... Also, this doesn't implement some stuff from gevent, it implements some stuff over and using gevent.
Yes that's exactly what I'm saying. If external code is less then some hundred lines of code, it would be better suited as a tutorial and people would be better at implementing those lines themselves. And yes, that's only my opinion.
Why should somebody who wants to use threading have to know how to write a preemptive scheduler? If you want a tutorial in addition to the library thats fine, but many good tutorials also release their code as libraries. In open source world, releasing code as a library does not mean having to keep people from understanding the workings of that code. Why should people HAVE to learn how the code works to use it though?