-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
use slots for ParkingLot and Event #1944
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1944 +/- ##
==========================================
- Coverage 99.58% 99.50% -0.09%
==========================================
Files 114 114
Lines 14617 14617
Branches 1116 1116
==========================================
- Hits 14557 14544 -13
- Misses 43 51 +8
- Partials 17 22 +5
|
LGTM. TBH we should probably rewrite |
merge blocked by #1938 |
The parts of ParkingLot used by Event() don't look heavy-- I guess Event could use a simple list of tasks and just iterate that on set(), vs. ParkingLot's OrderedDict and popitem() 🤷♂️ |
It would be a `set` of tasks, not a `list`, because cancellation needs to
be able to delete arbitrary items efficiently. But yeah, that's what I mean.
…On Sun, Apr 4, 2021 at 11:28 PM John Belmonte ***@***.***> wrote:
TBH we should probably rewrite Event at some point to use a plain set and
wait_task_rescheduled, instead of all the heavyweight ParkingLot machinery.
The parts of ParkingLot used by Event() don't look heavy-- I guess Event
could use a simple list of tasks and just iterate that on set(), vs.
ParkingLot's OrderedDict and popitem() 🤷♂️
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1944 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEU42DOVMTS5D57W6YDEGLTHFKA5ANCNFSM42MAQ2YQ>
.
--
Nathaniel J. Smith -- https://vorpus.org <http://vorpus.org>
|
…ngLot (#1948) * implement Event directly with wait_task_rescheduled rather than ParkingLot raised in #1944 * clear listening tasks set after rescheduling Co-authored-by: Nathaniel J. Smith <njs@pobox.com> * eliminate use of custom_sleep_data * newsfragment Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
closing in favor of #1948 |
Event
instances can be very numerous in a Trio program, especially considering idioms like "create a new event on every set()".Event
containsParkingLot
and neither were using slots, which is a source of garbage objects.closes #1943