News for hackers. Stuff that matters.
Re:Guido van Rossum joins Microsoft by colonwqbang on Thursday November 12, 2020 @06:28PM (#25076748)
Posix fork() doesn't really count, if that's what you mean...
Re:Guido van Rossum joins Microsoft by dragonwriter on Thursday November 12, 2020 @06:57PM (#25077008)
Why doesn't Python's multiprocessing module (which uses fork by default on Unix) count? It literally exists for parallelism.
Re:Guido van Rossum joins Microsoft by colonwqbang on Saturday November 14, 2020 @09:30AM (#25092472)
It's understood that you can have "parallelism" by running two copies of your program using basic system facilities like fork(), or even by buying several computers and running one instance of your program on each of them. That's not what is meant by a language "supporting parallelism". If it was, then every language ever designed supports parallelism and so the term is meaningless.

To claim that a language "supports parallelism", it has to do something more to facilitate parallel programming. I would say that parallel threads of computation with shared memory and system resources is the bare minimum. You can go the extra mile and support transactional memory or other "nice" abstractions which make parallel programming easier.

Saying that Python support parallelism because it has a fork() wrapper is like saying that Posix shell is a strongly typed language because it has strings and string is a type.

Re:Guido van Rossum joins Microsoft by int_19h on Thursday November 12, 2020 @10:07PM (#25078356)
It doesn't use fork() on macOS anymore, because some of Apple's own APIs get broken by its use.

Pretty much any app that uses both fork and threads, has to jump through many hoops to make the two work together well. And this applies to all the libraries that it uses, directly or indirectly - if any library spawns a thread and does some locking in it, you get all kinds of hard-to-debug deadlocks if you try to fork.

So unless you have very good perf reasons to need fork, I would strongly recommend multiprocessing.set_start_method("spawn") on all platforms. No obscure bugs, and it'll also behave the same everywhere, so things will be more portable. Code using multiprocessing that's written to rely on fork semantics can be very difficult to port later.

Re:Guido van Rossum joins Microsoft by guenthert on Friday November 13, 2020 @01:34PM (#25085731)
You wouldn't fork() for performance, but for security reasons.