5 ms·
>> Python has great concurrency primitives, including generators, greenlets, Deferreds, and futures. It's controversial statement. Generators, greenlets, defe
by kreshikhin 12y ago
>> Python has great concurrency primitives, including generators, greenlets, Deferreds, and futures.
It's controversial statement.
Generators, greenlets, deferreds, and futures, it's all not great concurrency primitives definitely. It's okay for typical "python" tasks, but many applications have needs in more powerful solutions like golang channels for example.
- rubiquity 12y agoGo's channels aren't a concurrency primitive, they are a concurrency abstraction. Goroutines are the primitive. I also don't think it would be hard to implement Go channel semantics in Python.
- kreshikhin 12y agoIn my opinion the difference between abstraction and primitives lies in fact that abstraction cannot be instantiated. Channels can be instantiated, goroutines cannot. Correct me if I'm wrong please.
- rubiquity 12y agoYour definition seems to have its roots tightly coupled to abstraction vs primitive in the sense of Object-oriented programming. Your use of the word "instantiation" makes me feel that way. Let me know if that is misguided. In the world of concurrency you could probably even call goroutines an abstraction but goroutines are at least closer to the fundamental concurrency primitives such as threads, locks, mutexes and tasks/coroutines/whatever.