What's the actual use of the Atomics object in ECMAScript?

后端 未结 5 1091
Happy的楠姐
Happy的楠姐 2021-02-07 23:04

The ECMAScript specification defines the Atomics object in the section 24.4.

Among all the global objects this is the more obscure for

5条回答
  •  滥情空心
    2021-02-07 23:46

    In addition to what Arseniy-II and Simon Paris stated, Atomics are also handy when you embed JavaScript engine into some host application (to enable scripting in it). Then one can directly access shared memory from different concurent threads simultaneously, both from JS and from C/C++ or whatever language your host application is written, without involving JavaScript API for access on C/C++/OtherLanguage side.

提交回复
热议问题