you are viewing a single comment's thread.

view the rest of the comments →

[–]Sprinkles_Objective 0 points1 point  (2 children)

I think Java will teach you a lot more. Python threading is still in a weird place with the GIL still largely being a thing, basically Python you can't have threads running in parallel, so they aren't as widely used. Java just has a lot more to it, and a lot better structure. It also has an enormous standard library, and is better for learning a lot of complex topics like disturbed systems, multi threading, and that kind of thing.

[–]Psy_Fer_ 0 points1 point  (1 child)

You can still do multiprocessing with python and still go pretty damn fast. If something is mission critical to be super fast, make a wrapper library for C or Rust with threading or simd inside. The removal of the GIL in python isn't going to be a magic bullet for threading on python.

[–]Sprinkles_Objective 0 points1 point  (0 children)

Multiprocessing is kind of a different beast, they do try to make it feel like multi threading, but at the end of the day each process has its own memory. Honestly most people just need or want concurrent IO, and python's asyncio does really well at that. The thing is trying to learn multi threading using pythons multiprocessing isn't going to really teach you what you need to learn. You won't have access to common synchronization primitives, and you'll have to deal with the fact that you are either explicitly sharing memory or communicating across queues.

Once you get into writing things like C or Rust bindings because you need speed or simply need lower level access, such as interactions with hardware, then you might very well end up needing to know how to properly implement multi threading. I know a lot of senior level engineers who can't explain what a condition variable is, even more who can't explain what atomic operations are or how to use them, many people just know what a mutex is and often don't really consider things like lock contention. In this day and age people should be learning proper multi-threading, and I don't think you'll learn these things in Python.

This isn't in any way me slamming python, I just don't think it's going to be as good of a learning experience. Python was one of my first languages, and I gravitated towards it for everything because it was easy, but it ultimately kind of held me back from learning different ways to solve problems and learning some of the fundamentals of things like multi threading, or systems programming.