Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Planning libuv v2

962 views

Published on

Planning of libuv v2. Slides from the meeting which took place in Node Inteactive 2016 in Amsterdam.

Published in: Technology
  • Be the first to comment

Planning libuv v2

  1. 1. Planning libuv v2 Node Interactive 2016 — Amsterdam
  2. 2. Present • Ben Noordhuis (@bnoordhuis) • Bert Belder (@piscisaureus) • Fedor Indutny (@indutny) • Saul Ibarra Corretge (@saghul) • Observers: Felix, Rob and Anna
  3. 3. Current status (v1.x) • New release is imminent: 1.10.0 • 7 maintainers, 5 active • 12 new APIs since 1.0.0 • ABI remains stable! • Release cadence: when enough fixes / features pile up
  4. 4. Current status (master) • Supported platforms cleanup • ABI compatibility hacks removed • Some PRs pending review
  5. 5. The 10k ft view • Internal cleanups / improvements • Add new APIs which could’t land on v1.x • Evolutionary, not too many breaking changes • More approachable -> more & better docs
  6. 6. Open PRs for v2 • Timer wheels • uv_fs_{open,read,close}dir • Changes to uv_interface_addresses / uv_cpu_info • uv_device_t (stalled)
  7. 7. Pain points • Documentation • Multi-threaded applications • TLS support • Serial port access
  8. 8. Documentation • Improve existing API docs • Merge in the uvbook (author agreed to help!) • Add sample applications (ex. simple HTTP client)
  9. 9. Multi-threading • We need a better story for our thread pool • Easier way for sending handles from one loop to another • (long term) Thread-safe APIs?
  10. 10. Actionable Items
  11. 11. libuv-extras • Inaugurate libuv-extras with uv_ssl_t + uv_link_t (@indutny) • Different support guarantees • A serial port support module could land there, needs a champion
  12. 12. Timers • Use a timer wheel? • Linux removed them! Worst case scenario is far worse. Complex implementation. • Repeating timers are weird for some, get rid of them • Use sub-millisecond precision where possible: use a double • int uv_timeout(uv_timeout_t* req, double timeout, uv_timeout_cb cb) • uv_timer_t remains, built on top of uv_timeout • @saghul
  13. 13. uv_read() • New API functions • uv_pollin: Poll for readability • uv_pollin(uv_poolin_t*req, uv_stream_t* stream, uv_pollin_cb cb) • uv_read: Read into a pre-allocated buffer • uv_read(uv_read_t* req, const uv_buf_t[] bufs, unsigned nbufs, uv_read_cb cb) • uv_try_read: Read inline • uv_try_read(uv_stream_t* stream, const uv_buf_t[] bufs, unsigned nbufs); • @piscisaureus will kickstart the work
  14. 14. Reentrant uv_run • Very complex. • Not for now.
  15. 15. uv_pipefds • Simplify the master process + multiple workers scenario • int uv_pipefds(uv_file[2], int flags) • Problem: pipe mode on Windows: overlapped vs blocking • @saghul
  16. 16. Threadpool • Hooks for running tasks in a thread pool • Pluggable • Default implementation • @bnoordhuis will write a LEP
  17. 17. LEP cleanup • Deal with stalled LEPs • Break the big one into smaller pieces • @saghul
  18. 18. Task list • Merge timers • uv_timeout • Start uv_read • Threadpool rework • Docs • uv_read
  19. 19. Schedule • When It’s Ready (R)

×