Opened 22 months ago
Closed 20 months ago
#25374 closed defect (implemented)
Create a better-designed system for handling computation outside the event loop
Reported by: | nickm | Owned by: | nickm |
---|---|---|---|
Priority: | Low | Milestone: | Tor: 0.3.4.x-final |
Component: | Core Tor/Tor | Version: | |
Severity: | Normal | Keywords: | 034-roadmap-subtask, 034-triage-20180328, 034-included-20180328 |
Cc: | Actual Points: | ||
Parent ID: | #25500 | Points: | |
Reviewer: | dgoulet | Sponsor: | Sponsor8 |
Description
Right now, we do a couple of things in run_main_loop_once
that happen outside the event loop (because we want to re-scan for events event loop before they happen):
- Making events on active_linked_connection_lst active.
- Running connection_ap_attach_pending.
But we can do this much better. With Libevent 2.1, instead of making the loop exit for this, we can should do all of these things in a separate event callback, and call event_base_loopcontinue()
at the end of that event's callback so that the event_base will get rescanned before we return. With earlier versions of Libevent, we can do something similar with event_base_loopbreak().
Doing this won't lower the number of wakeups we do, but it should simplify our overall event loop logic, and make other event loop simplifications easier.
Child Tickets
Change History (12)
comment:1 Changed 21 months ago by
Parent ID: | → #25500 |
---|
comment:2 Changed 21 months ago by
Owner: | set to nickm |
---|---|
Status: | new → accepted |
comment:3 Changed 21 months ago by
Keywords: | 034-roadmap-subtask added |
---|
comment:4 Changed 21 months ago by
Keywords: | 034-triage-20180328 added |
---|
comment:5 Changed 21 months ago by
Keywords: | 034-included-20180328 added |
---|
comment:6 Changed 21 months ago by
I've started work here in a branch called postloop_callbacks
based on isolate_libevent_2
. It still needs tests and a changes file, and we'll need to rebase it once isolate_libevent_2
is squashed and merged.
comment:7 Changed 20 months ago by
Status: | accepted → needs_review |
---|
Now that isolate_libevent_2
is merged, this branch can get reviewed. Please see postloop_callbacks_2
on github and tor-git.
comment:9 Changed 20 months ago by
Reviewer: | → dgoulet |
---|
comment:10 Changed 20 months ago by
per dgoulet's request, I've rebased the branch onto master, and force-pushed it.
comment:11 Changed 20 months ago by
Status: | needs_review → merge_ready |
---|
Let a comment on the PR: https://github.com/torproject/tor/pull/41#issuecomment-381180728
This is merge_ready after that imo.
comment:12 Changed 20 months ago by
Resolution: | → implemented |
---|---|
Status: | merge_ready → closed |
Resolved issue; merging now!
Setting master ticket parent ID.