-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix several greenlet leaks #261
Commits on Sep 29, 2021
-
A bare Event.wait() with no timeout is an invitation to hang the proc…
…ess. Add a timeout to all such instances.
Configuration menu - View commit details
-
Copy full SHA for 54105f0 - Browse repository at this point
Copy the full SHA 54105f0View commit details
Commits on Oct 12, 2021
-
See if all compilers can work in C++ mode.
Thread-local C++ objects should be a portable way to get thread destructors. The slp_* functions need to be compiled as C because we call them from assembly. forward declarations should also be c linkage, otherwise MSVC complains.
Configuration menu - View commit details
-
Copy full SHA for 24e4cba - Browse repository at this point
Copy the full SHA 24e4cbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for e960906 - Browse repository at this point
Copy the full SHA e960906View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1921580 - Browse repository at this point
Copy the full SHA 1921580View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8dcf174 - Browse repository at this point
Copy the full SHA 8dcf174View commit details -
Port all global variables to a threadlocal struct.
This eliminates the complexity of green_updatecurrent, I believe. Much more can be simplified as well. Still need to add the thread cleanup functions.
Configuration menu - View commit details
-
Copy full SHA for 82be175 - Browse repository at this point
Copy the full SHA 82be175View commit details -
Currently, we're somewhat slower than the global variable case, as expected. | Benchmark | gl-1.1.2 | tl1 | |------------------------------|:--------:|:---------------------:| | create a greenlet | 68.7 ns | 88.0 ns: 1.28x slower | | switch between two greenlets | 301 ns | 435 ns: 1.45x slower | | getcurrent single thread | 17.9 ns | 31.8 ns: 1.78x slower | | chain(100000) | 256 ms | 275 ms: 1.08x slower | | Geometric mean | (ref) | 1.37x slower | Also some Windows debugging.
Configuration menu - View commit details
-
Copy full SHA for ff3c7c2 - Browse repository at this point
Copy the full SHA ff3c7c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 024d3d7 - Browse repository at this point
Copy the full SHA 024d3d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b7906c - Browse repository at this point
Copy the full SHA 1b7906cView commit details -
g_switchstack was using a stack local variable, which it can't do.
Amusingly, this only caused issues on 64-bit Python 3.9 and 3.10 an Windows.
Configuration menu - View commit details
-
Copy full SHA for 7e24943 - Browse repository at this point
Copy the full SHA 7e24943View commit details -
Perhaps MSVC was combining the two apparent copies of g_thread_state_…
…global in g_switchstack into a single copy, thus messing up the stack. Try accessing it with the global variable each time. This makes clang, at least, look it up each time, even with optimizations on.
Configuration menu - View commit details
-
Copy full SHA for be25e20 - Browse repository at this point
Copy the full SHA be25e20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2cd7d74 - Browse repository at this point
Copy the full SHA 2cd7d74View commit details -
Configuration menu - View commit details
-
Copy full SHA for c79a40a - Browse repository at this point
Copy the full SHA c79a40aView commit details -
We're now using Py_AddPendingCall to clean up some thread-local things that don't clean themselves up. I'm still working to be sure we break cycles.
Configuration menu - View commit details
-
Copy full SHA for d59bb5b - Browse repository at this point
Copy the full SHA d59bb5bView commit details -
You need special syntax to return a pointer in a noinline function in MSVC. Because the parser ignores, without warning, __declspec after a * character. https://docs.microsoft.com/en-us/cpp/cpp/declspec?view=msvc-160
Configuration menu - View commit details
-
Copy full SHA for 2f22881 - Browse repository at this point
Copy the full SHA 2f22881View commit details -
Configuration menu - View commit details
-
Copy full SHA for caf72df - Browse repository at this point
Copy the full SHA caf72dfView commit details -
You can't call PyObject_Print if there's an error set.
Improve the debugging to not do that. Also limit it to a suspected issue for now.
Configuration menu - View commit details
-
Copy full SHA for 32e7124 - Browse repository at this point
Copy the full SHA 32e7124View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb14308 - Browse repository at this point
Copy the full SHA cb14308View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b19e32 - Browse repository at this point
Copy the full SHA 0b19e32View commit details -
Checkpoint moving to a more flexible use of TLS.
This should let us restore support for older compilers.
Configuration menu - View commit details
-
Copy full SHA for 9ad0d55 - Browse repository at this point
Copy the full SHA 9ad0d55View commit details -
The indirect TLS support appears to be working, and I have fixed #252
I haven't tested this on other platforms or with a more complex app like gevent yet though.
Configuration menu - View commit details
-
Copy full SHA for 340664f - Browse repository at this point
Copy the full SHA 340664fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e5fa2a - Browse repository at this point
Copy the full SHA 5e5fa2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a2a33d - Browse repository at this point
Copy the full SHA 3a2a33dView commit details -
Configuration menu - View commit details
-
Copy full SHA for da7f417 - Browse repository at this point
Copy the full SHA da7f417View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf4f729 - Browse repository at this point
Copy the full SHA cf4f729View commit details -
Queue pending cleanups to reduce the number of Py_AddPendingCall slot…
…s we take. Also add a testing API to be sure cleanups have finished.
Configuration menu - View commit details
-
Copy full SHA for a421362 - Browse repository at this point
Copy the full SHA a421362View commit details -
Configuration menu - View commit details
-
Copy full SHA for f80d0fb - Browse repository at this point
Copy the full SHA f80d0fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3211747 - Browse repository at this point
Copy the full SHA 3211747View commit details -
Configuration menu - View commit details
-
Copy full SHA for a22f68e - Browse repository at this point
Copy the full SHA a22f68eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 62fac36 - Browse repository at this point
Copy the full SHA 62fac36View commit details -
Stop including headers we know aren't present. We got to that point o…
…f the compile on old MSVC.
Configuration menu - View commit details
-
Copy full SHA for 3662fba - Browse repository at this point
Copy the full SHA 3662fbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9256f4c - Browse repository at this point
Copy the full SHA 9256f4cView commit details -
MFC was a no-go. So use the win32 API.
may need to force linking with kernel32
Configuration menu - View commit details
-
Copy full SHA for 6c350ef - Browse repository at this point
Copy the full SHA 6c350efView commit details -
Introduce PyMainGreenlet as a subtype of greenlet.
This way we don't have to grow the greenlet class by a pointer that is almost always empty. Also brings more type safety to the code.
Configuration menu - View commit details
-
Copy full SHA for 4a35c59 - Browse repository at this point
Copy the full SHA 4a35c59View commit details -
Fix bad descriptor error on Python 2.7 for the main greenlet, and com…
…pilation error on MSVC.
Configuration menu - View commit details
-
Copy full SHA for e25aea0 - Browse repository at this point
Copy the full SHA e25aea0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bf7906 - Browse repository at this point
Copy the full SHA 5bf7906View commit details -
Add GHA test cases that disable the use of standard threading.
It passes for me locally.
Configuration menu - View commit details
-
Copy full SHA for 9b94af6 - Browse repository at this point
Copy the full SHA 9b94af6View commit details -
Configuration menu - View commit details
-
Copy full SHA for fadae21 - Browse repository at this point
Copy the full SHA fadae21View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcaf0f1 - Browse repository at this point
Copy the full SHA bcaf0f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7dbfe4 - Browse repository at this point
Copy the full SHA a7dbfe4View commit details -
Passing the thread state through all the calls was too much, see if w…
…e can save just this one.
Configuration menu - View commit details
-
Copy full SHA for c7841e3 - Browse repository at this point
Copy the full SHA c7841e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04c9166 - Browse repository at this point
Copy the full SHA 04c9166View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6061284 - Browse repository at this point
Copy the full SHA 6061284View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99d7f0d - Browse repository at this point
Copy the full SHA 99d7f0dView commit details -
Configuration menu - View commit details
-
Copy full SHA for af9b38c - Browse repository at this point
Copy the full SHA af9b38cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0792917 - Browse repository at this point
Copy the full SHA 0792917View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aee563 - Browse repository at this point
Copy the full SHA 5aee563View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f31618 - Browse repository at this point
Copy the full SHA 7f31618View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ec6c35 - Browse repository at this point
Copy the full SHA 4ec6c35View commit details -
Configuration menu - View commit details
-
Copy full SHA for d18ac12 - Browse repository at this point
Copy the full SHA d18ac12View commit details -
Ensure more tests don't leak greenlets.
Unfortunately, one still does and we have to manually cleanup a few others. Those can be fixed later.
Configuration menu - View commit details
-
Copy full SHA for 0da2574 - Browse repository at this point
Copy the full SHA 0da2574View commit details -
Configuration menu - View commit details
-
Copy full SHA for b8a8a84 - Browse repository at this point
Copy the full SHA b8a8a84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6358768 - Browse repository at this point
Copy the full SHA 6358768View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a28424 - Browse repository at this point
Copy the full SHA 1a28424View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4099794 - Browse repository at this point
Copy the full SHA 4099794View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d155fa - Browse repository at this point
Copy the full SHA 3d155faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33c667c - Browse repository at this point
Copy the full SHA 33c667cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 831ed82 - Browse repository at this point
Copy the full SHA 831ed82View commit details -
Configuration menu - View commit details
-
Copy full SHA for bef2234 - Browse repository at this point
Copy the full SHA bef2234View commit details -
Configuration menu - View commit details
-
Copy full SHA for 291c7a1 - Browse repository at this point
Copy the full SHA 291c7a1View commit details -
Always use RAII/stack-based locking/unlocking.
This is less error prone.
Configuration menu - View commit details
-
Copy full SHA for 893844a - Browse repository at this point
Copy the full SHA 893844aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e342bda - Browse repository at this point
Copy the full SHA e342bdaView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb61b4c - Browse repository at this point
Copy the full SHA eb61b4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf3637d - Browse repository at this point
Copy the full SHA cf3637dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d85029 - Browse repository at this point
Copy the full SHA 7d85029View commit details