Does V8 have an event loop?

后端 未结 1 1261
盖世英雄少女心
盖世英雄少女心 2020-12-31 15:08

I keep hearing V8 has its rudimentary event loop implementation but

  1. couldn\'t find it
  2. doesn\'t really make sense to me. Methinks, the simplest design
1条回答
  •  无人及你
    2020-12-31 15:24

    Your intuition is right that the event loop is something that embedders should have control over. However, it is also a fundamental abstract concept of the JavaScript programming model. V8's solution is to provide a default implementation that embedders can override; you can find it in the "libplatform" component: https://chromium.googlesource.com/v8/v8/+/master/src/libplatform/default-platform.cc#140

    See also Relationship between event loop,libuv and v8 engine

    0 讨论(0)
提交回复
热议问题