[tor-bugs] #25374 [Core Tor/Tor]: Create a better-designed system for handling computation outside the event loop

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Feb 27 20:58:11 UTC 2018


#25374: Create a better-designed system for handling computation outside the event
loop
------------------------------+--------------------------------
     Reporter:  nickm         |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Low           |  Milestone:  Tor: 0.3.4.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:  Sponsor8      |
------------------------------+--------------------------------
 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.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25374>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list