NeXuS VUS (Very Unuseful Stuff)
About me, my thoughts, my life and much other unuseful stuff… I know, I know: unuseful is not a word!
Sorry, this entry is only available in Italiano and English.
Tasklets and Goroutines are both green treads (e.g. are lightweight ans scale well compared to OS-level threads) , so there shouldn’t be much difference there.
One thing I suspect might be different is that goroutines are supposted to be distributed over a set of threads, where as tasklets only run in one thread (and also only on one core due to the GIL in Python, which means Stackless wouldn’t scale on a multi core system at all).
Goland manages goroutines and can reallocate goroutines to a different os-thread if one goroutine block (on IO for instance).
This adds could add some overhead.
For what I know Golang doesn’t use this feature yet, since it’s not stable yet. So I’m not sure if it has anything to do with the difference in speed.
Your test with an added load is interesting, because the original test results in just a number of function calls, for which Python could do very well. The biggest difference between Golang and Python is in the typesystem, the intepreter is pretty much the least slow thing for that kind of test.
Sorry, but Tasklets and Goroutines are both coroutines, not Green Threads (e.g. a Thread containing only one routine is a coroutine as well).
Tasklets are implemented as Green Threads (they are entirely managed by the Python VM), while Goroutines, as of now, are P-Threads.
I guess the idea for the future is, as you said, to have only a few OS threads and multiplex the Goroutines upon them, but that would require features that are not present in the runtime right now.
Molto interessante! Certo che Ã¨ raro trovare un linguaggio piÃ¹ lento di python! 🙂
Possibile che vogliano sacrificare cosÃ¬ tanto in cambio di una compilazione veloce? A quel punto, perchÃ© non usare un interprete e un lint? 😀
(tra l’altro non avevo ancora sentito parlare di stackless python, direi che ha delle caratteristiche decisamente interessanti, da approfondire)
Cominciano ad essere riconosciuti i tuoi meriti:
Google, nel 2010
arriva lo smarthphone
SarÃ venduto online
e senza intermediari
Si chiamerÃ Nexus One. I servizi di telefonia mobile verranno acquistati separatamente
Casomai interessasse: “GCC to merge Go support” 😀
//you need set use max cpu, default use one cpu
Except my old laptop had a single CPU with a single core… 🙂
Yes it has green threads (stackless) that allow quickly create many lightweight threads as long as no operations are blocking (something like Ruby’s threads?). What is this great for? What other features it has I want to use over CPython?
Your email address will not be published. Required fields are marked *