8000 gh-131757: allow lru_cache functions to execute concurrently by tom-pytel · Pull Request #131758 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131757: allow lru_cache functions to execute concurrently #131758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
requested changes
  • Loading branch information
tom-pytel committed Mar 27, 2025
commit 34f7fe7d3e46506b4d670b8712573b9c20c3999b
7 changes: 4 additions & 3 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,9 +1489,10 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds
result = PyObject_Call(self->func, args, kwds);

Py_BEGIN_CRITICAL_SECTION(self);
/* Note: key will be released in the below function and
result may be relased on error, or returned as a passthrough
or have its reference count increased if is added to cache. */
/* Note: key will be stolen in the below function, and
result may be stolen or sometimes re-returned as a passthrough.
Treat both as being stolen.
*/
result = bounded_lru_cache_update_lock_held(self, result, key, hash);
Py_END_CRITICAL_SECTION();

Expand Down
Loading
0