Liste des Groupes | Revenir à co vms |
On Mon, 30 Sep 2024 20:48:53 -0400, Arne Vajhøj wrote:Practically all GUI's are multi-threaded.The world is moving from forking processes to starting threads.That was tried in the 1990s -- threads for everything, even multithreaded
GUIs. It was soon discovered that was not a great idea.
Java, perhaps, embraced threads more than anybody: it made such heavy useThere is no data in the object itself for it.
of threads that it never even bothered to define a separate “lock” object
type: instead, locking calls are built into the behaviour of every object!
>
No other language copied that feature. Wonder why not?
Threading is also a very convenient programming model for IO.As soon as Python are done getting rid of GIL then it willWe understand better what to use threads for these days. They are good for
join the thread party!
CPU-intensive tasks that are parallelizable, not so much for anything
else. That CPU-intensive stuff is not something you would tend to do in
Python itself anyway: for high performance, you would delegate those tasks
to “extension modules” written in C or such compiled languages. The usual
flow within the extension code is
* Grab data from Python objects into some efficient native format
* Free the GIL
* Perform CPU-intensive tasks
* Re-acquire the GIL
* return results in Python objects
That third step takes full advantage of multithreading, without having to
worry about the strictures of the Python GIL.
Les messages affichés proviennent d'usenet.