EcmaScript规范是否对用于实现运行时的流程模型施加了任何约束? [英] Does the EcmaScript specification place any constraints on the process model used to implement the runtime?

查看:109
本文介绍了EcmaScript规范是否对用于实现运行时的流程模型施加了任何约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

EcmaScript规范是否对用于实现运行时的流程模型施加了任何约束?

Does the EcmaScript specification place any constraints on the process model used to implement the runtime?

例如,事件循环是否需要位于单独的线程上管理与操作系统IO子系统的运行时通信的线程?

For example, is the event loop required to be on a separate thread from the thread managing the runtime communication with the operating system IO subsystems?

推荐答案

不,它没有具体说明这些。运行时通信和IO甚至不是语言的一部分,它们作为依赖于实现的外来对象。

No, it does not specify anything about those. Runtime communication and IO are not even part of the language, they come as implementation-dependent exotic objects.

ECMAScript规范甚至不使用术语事件循环,虽然确实定义了工作和工作队列哪个工作相似。然而,没有理由实现具有多个线程的那些,毕竟,JS总是按顺序运行。

The ECMAScript specification does not even use the term "event loop", though it does define Jobs and Job Queues which work similar. There is no reason however to implement those with multiple threads, after all, JS alone always runs sequentially.

相比之下,HTML5规范确实定义了事件循环甚至流程模型,但不要求多线程。

In contrast, the HTML5 spec does define event loops and even a process model, but there is no requirement about multithreading either.

这篇关于EcmaScript规范是否对用于实现运行时的流程模型施加了任何约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆