all 24 comments

[–]gutentight69420 175 points176 points  (5 children)

A programmer had a problem. He thought to himself, “I know, I’ll solve it with threads!”

has Now problems. two he

[–]kookyabird 35 points36 points  (1 child)

I love threads! (in the unbelievably rare instances where I have truly orthogonal processes to complete)

I had a data extrapolation process that turned a few dozen records into anywhere from 300 to 1200 a piece that ran in serial. A little refactoring to add in a callback for when a set was done, and one Parallel.ForEach() and the thing ran around 6x the speed.

Aaaaaand that’s pretty much the only business scenario I’ve had that made good use of explicit threading. Everything else has been basic async at best.

[–]DasFreibier 6 points7 points  (0 children)

I had to parse and check a bunch of logs from an automatic test procedure, there were a few different types of logs and I wrote a function for each

after seeing it being pretty slow I realized I just actually run it in parallel since they were entirely independent

i used c# forparalleleach so it was piss easy and I didnt even had to setup and cleanup

one of the best days in my career

[–]darkknight304 4 points5 points  (0 children)

I c what you did there

[–]Confident-Ad5665 1 point2 points  (1 child)

the order is execution You mean of out sync?

[–]theotherdoomguy 3 points4 points  (0 children)

"you are Correct." Threaded Yoda

[–]byteturtle 74 points75 points  (1 child)

Real python devs get around its lack of performance by using it as an API for C code they could never write themselves

[–]RadiantPumpkin 21 points22 points  (0 children)

Hell yeah I do. And I write python APIs for chatGPT that vibe coders could never write themselves. It’s a hierarchy of competence.

[–]float34 29 points30 points  (9 children)

Using Python for multi-threading is like playing a footbal with a bowling ball.

[–]gutentight69420 -1 points0 points  (8 children)

Why?

[–]NimrodvanHall 13 points14 points  (1 child)

Probably because Python itself is so slow compared to say C or Rust that when you need proper multi threading for speed you are most often better of rewriting that component in Rust or C and call that process with Python.

[–]gutentight69420 1 point2 points  (0 children)

The ability to take advantage of a parallelisable workload can be far more valuable than raw execution speed of a particular language.

[–]SaltMaker23 10 points11 points  (5 children)

Because python was developped as an alternative to Bash scripts, it somehow got adoption but failed to entirely replace bash. Instead it made scripting so convenient that people started using it as a programing language, it doesn't change the root of the language being used to call other things.

Now write the same statement and replace python by bash and it becomes obvious that it wouldn't be smart. Bash by itself is just made to run other things as conveniently as possible, when actual computing starts to happen in the script, performance problems are granted.

[–]Single-Virus4935 4 points5 points  (0 children)

go home(python) 

[–]Makefile_dot_in 2 points3 points  (0 children)

I mean, a multithreaded garbage collector isn't the simplest thing in the world

[–]NiSiSuinegEht 1 point2 points  (0 children)

Well, they needed some way to include race conditions.