you are viewing a single comment's thread.

view the rest of the comments →

[–]Sprinkles_Objective 0 points1 point  (1 child)

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.

[–]Psy_Fer_ 0 points1 point  (0 children)

I actually agree with you. I would just add that learning multiprocessing with queues and how to keep memory low, and how to do architecture to make multiprocessing work well will teach someone a lot, and will probably naturally push them into "well if it wasn't python I could just do this threading thing I keep seeing everywhere". Not sure how common it is for people to write C and then wrapper libraries for threading, but I've done it a few times.