Skip to content

Commit

Permalink
docs: add a note and reference to event loop design
Browse files Browse the repository at this point in the history
  • Loading branch information
symbiont-stevan-andjelkovic committed Aug 3, 2021
1 parent 2ee9f69 commit 860d783
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime-prototype/event-loop.org
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ queue | __ __ __ | -.
...
ls := ... // the event loop state, contains the event queue etc.
for {
runHandlers(ls)
// NOTE: we used to run the handlers in random order to maximise coverage,
// but it turns out a lot of time is spent randomising and also randomness
// can potentially ruin branch predicition in the CPU.
runHandlers(ls) // TODO: which order do we run the handlers in?
}
}
#+end_src go
Expand Down Expand Up @@ -405,3 +408,4 @@ queue | __ __ __ | -.
* Resources
** http://ithare.com/five-myths-used-in-golang-vs-node-js-debate/
** [chat server implemented using select/poll/epoll/uring](https://github.com/robn/yoctochat)
** [Data-Oriented Design](https://dataorienteddesign.com/dodbook/)

0 comments on commit 860d783

Please sign in to comment.