4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions
comment 3y ago · link · parent
Means cheap enough to be mass produced, and available.
> But most importantly, the power grid doesn't lose all that much to resistance
Laws of scaling, even a small percentage of power lost to resistence is a hige overall loss, the avoidance of which is desirable.
And as I said, this is only the simplest example.
comment 3y ago · link · parent
comment 3y ago · link · parent
Even the simplest example of what that would mean is already amazing to our society: Imagine a power-grid that no longer loses power to electrical resistence in the wires.
comment 3y ago · link · parent
Can I plug in the device into my PC/Notebook and up/download documents via the cable?
If the answer is no, or contains the word "Cloud" at any point other than in the context that there is no need to use any "Cloud" to up/download documents, then I don't care how well made the product is, I don't care how good the writing experience is; If a notetaking device doesn't work without relying on some "cloud", I won't buy it, end of story.
comment 3y ago · link · parent
If favorable, but short lived conditions were behind this sudden change, then it would affect the entire economic system, not just the workforce.
How well people are off is a function of how many resources there are to go around. Since the end of WWII, these resources only ever increased. So did worker productivity, aka. the amount of resources produced per worker. So if people are worse off now, that leads to the very easy deduction that the fault lies in how these resources are distributed, not with a scarcity of the resources themselves.
Or to put this another way:
If the previously better conditions were just a fluke that couldn't be expected to last, how come that corporations seem to rake in ever more money as time goes on?
comment 3y ago · link · parent
Who's we?
I know I am living a privileged comfortable life, yes. I am certain many people in my chosen profession as a software dev do.
But I also know that there are alot more people struggling to provide basic necessities for their families, despite working 40+h per week. And I am not talking about cellphones here. I am talking about a roof over ones head, clothes on ones back, food on the table and medical services.
comment 3y ago · link · parent
We know that it isn't. Productivity of the workforce is ever increasing. The generated wealth simply doesn't make it to the workforce.
comment 3y ago · link · parent
That is true, but understandably, people are not thrilled about the prospect of their conditions being worse than those their predecessors experienced.
Especially not if, at the same time, they experience an uninterrupted period of economic growth and ever growing profit margins for the corporations they work for.
comment 3y ago · link · parent
If the reward from working is barely enough to cover the necessities, then there is technically no difference between working as a free citizen, and being forced to work as an indentured servant, other than a vague notion of freedom, which in that case is the freedom to decide between working and living on the streets.
And people don't like being indentured servants. History should have made that clear by now.
People want perspective. In the past, a working man could support a family of five, buy a house, a car and afford vacation once or twice a year, plus save enough to retire comfortably.
Today people, despite burning themselves out in their job, struggle to pay rent in a flat shared with other working people, after loading themselves up with 100k in students debt, and no chance in hell to ever own property of their own.
If the powers that be want people to be willing to work, that work has to pay off.
If it doesn't, well...we're at the beginning of a retirement wave unprecedented in human history. 2 low-birthrate generations to follow. And our entire economic system is designed around constant growth.
I leave doing the math on that as an exercise for the reader.
comment 3y ago · link · parent
Even for such stable languages, a library maintainer has to, at the very least, patch security problems as they are discovered.
> That does not sound like everyone except for the proponents is supposed to be heard (or is even aware of the discussion).
There is an official poll among the Python core devs, linked in the article, which shows overwhelming support for the change. Since they are the ones who have to work this out, that's the only discussion about this that is relevant.
comment 3y ago · link · parent
"We also need to bring along the rest of the Python community as we gain those insights and make sure the changes we want to make, and the changes we want them to make, are palatable."
End quote.
Yes, library developers have to keep up with developments in the underlying language as well as changes in usage patterns by the community. That is true for all programming languages.
And as I have pointed out numerous times before, this change is on the wishlist of many libdevs in the python community.
comment 3y ago · link · parent
Except that the threads share the exact same virtual address space, and processes do not, which makes the thread context switch faster.
And that is to say nothing about the setup and teardown process, which for a process involves copy-on-demand'ing the entire memory, but for a thread merely setting up its own stack.
comment 3y ago · link · parent
I am perfectly aware that threads are not free.
Just as I am perfectly aware that a context switch between threads is less expensive that switching a new process onto the core, and that IPC requires kernel involvement.
comment 3y ago · link · parent
Interesting, care to explain then why Python supported threading since Python2? [1]
> Once again, if you are using python as a scripting language
> If that's true, then you shouldn't use python.
Once again, I don't. I use it as an orchestration language calling other code, and there is no good reason why the orchestration language should have an arbitrary bottleneck.
Yes, the hot code isn't written in Python. That doesn't matter to this discussion.
> In the "web application" example you are using, the norm is already to have many processes to handle incoming connections.
Outside of the python world, it absolutely isn't. I also have numerous Go based webservices, and they don't have to jump through ICP hoops to facilitate communications between workers and services.
comment 3y ago · link · parent
No, they did not.
That's why the discussion about the GIL is about as old as Python3 itself.
The GIL has always been a major drawback of python, moreso because the language does in fact have threading support...only it can't use threads for parallel workloads.
This drawback was tolerated, because of the many advantages Python brings to the table, and because Python comes from an age when Moores Law was still in full effect; Powerful single cores were the norm not so long ago.
This isn't the case any more. Moores Law is done. Now we increase the number of cores, and languages that wish to remain relevant, need to reflect that.
comment 3y ago · link · parent
How do you figure that? Even python2 already supported the usage of OS threads [1].
> 30+ years' worth of 3rd-party packages and libraries which were never built with multithreading in-mind
Many of these packages also don't use other forms of concurrency, but are simply encapsulated functionality that runs in a single thread. Meaning, they will not be bothered by the change.
Besides, as I have mentioned elsewhere, library maintainers always need to keep up with the development of the underlying language as well as usage patterns of the community, or their libraries become obsolete. That is true no matter what programming language we talk about.
> If you need hardcore, ultra efficient and parallelized workflows - Python is just the wrong tool for the job period
Python is already used as an orchestration language for huge numerical workloads, be it data science or machine learning. It is simple, intuitive and has by far the largest library support of any contemporary language.
There is simply no good argument, why the language that we entrust to orchestrate this scale of computing power, shouldn't itself be as efficient as possible for a dynamically typed script-language. That this is absolutely possible, is demonstrated by languages like Julia.
The fact that Python will never be as fast as Go, Rust or C++, doesn't change that.
> Those people want to get shit done quickly - and mutexes, sempahores, events, threads, synchronization primitives, atomics, etc - will do nothing but make their lives a misery, and drive them away.
Those people will for the most not even realize that the GIL is gone. If they write...
- single threaded synchronous code
- asyncio based code
- multiprocessing code
...the change doesn't matter to them. The hobbyists small webserver, or the medium companies Flask-based webapp will still run as before. And if they write threading code, and do so correctly, then it is very likely the only change they will see, is that suddenly their application runs faster under high load.The removal of the GIL neither takes away existing capabilities from Python, nor does it force everyone to write threading code.
> and you're not really responding which makes me feel like we're not conversing here...
That's because I have done so elsewhere in this thread already [2]
comment 3y ago · link · parent
I know. I have a werkzeug/gunicorn application that currently runs 60 worker processes on a 64 core server.
And I would love nothing better than to rip out every. single. last. one. of the IPC facilities, and replace them with the same easy and convenient mutex and CSP systems, that I can use in my Golang applications.
> They are recommended because they are much, much faster, period.
I know, but "rewrite it in Rust/Go/C++" isn't always an option, be it because of legacy status, constraints in available dev-hours, compatibility problems, library support or simply ease of use.
comment 3y ago · link · parent
That still relies on IPC, and the associated kernel overhead to set, ctl and access the shared memory, IN ADDITION to the kernel overhead of having to do a context switch between processes.
Threads only rely on the context switch.
> I am just advocating it as the better model for Python to advance to
https://discuss.python.org/t/poll-feedback-to-the-sc-on-maki...
comment 3y ago · link · parent
Please explain who exactly is "drawn into this"?
If you want to use async, this change doesn't affect your code.
If you want to use multiprocessing, this change doesn't affect your code.
Even if you already use threading, and do it correctly, this change doesn't actually affect your code.
So who is "drawn into this"? And please don't say library developers. a) Having to update libraries to have them remain relevant, is normal procedure, in all languages. b) a lot of the people who want this to change are library devs.
comment 3y ago · link · parent
I also don't need to use goroutines. I could simply spin up my golang application as a couple of processes, and use pipes and other IPC to coordinate them.
"There is another way to do X" doesn't imply that other way is better.
comment 3y ago · link · parent
No, it doesn't.
def thread_function():
# thread may lose core here
value = store.get_value() # or anywhere inside get_value
# or here
update(value) # or anywhere inside update()
# or here
store.put_value(value) # or anywhere inside put_value()
The GIL only makes certain internal functionality atomic. It doesn't protect the implemented logic from causing a race condition.So unless I protect store with a lock, I can already get a race condition, GIL or no GIL.
comment 3y ago · link · parent
I shall be more than happy to provide them:
Supporting thread based parallelism is the norm among all mainstream PLs with the one inglorious exception of JS, which doesn't because it simply can't.
And Python already does support it, it simply is limited by a legacy design decision. That was okay in a bygone age when fast single core machines were still the norm, Python was primarily a scripting language for when bash wasn't enough, and most relevant webapps were IO bound.
Today, there simply is no excuse any more. Python is the most ubiquitous language in the world, and running scaling web applications, is the lingua franca of ML, and orchestrates huge systems. Servers have hundreds of cores, and CPU bound workloads become ever more important.
It's about time Python rids itself of that needless limitation.
comment 3y ago · link · parent
The motivation summary of PEP-703 contains some material on this:
https://peps.python.org/pep-0703/#motivation
Further discussions going back years can be found with a brief search. This discussion is almost as old as Python3.
> due to a lack of awareness of available (& often better) alternatives to threading.
Such as?
There are exactly 2: asyncio, which is useless for CPU/GPU bound workloads, and multiprocessing with all the pain of relying on expensive spawns, expensive and limited IPC and the joy of having to orchestrate across process boundaries.
Guess what the most common advice is for dealing with CPU bound parallelisation problems in Python? "Use another language". Guess what all the languages recommended (C, C++, Rust, Go, Java) have in common? They have thread-based parallelism.
> There is a very small number of use cases that will benefit from free threading.
Basically any workload that is CPU bound, which in the day and age of giant data aggragation and running huge ML models at scale is more important than every before, is a use case for this.