Name | URL |
---|---|
holee | |
sunpark | |
dongbkim | |
gim | |
sohpark | |
nkang | |
yujo |
nkang
- SIMD(Single instruction, multiple data)는 "data parallelism"의 형태로 ES6에서 사용가능해졌다.
- dedicated Wokers는 그들을 실행시킨 프로그램이 종료되면 함께 종료된다.
- Shared Workers는 호출하는 프로그램들을 구분하여 통신하기 위해
port
객체를 반드시 사용해야 한다. - Shared Workers를 사용하는 것은 중복된 dedicated Workers 사용으로 인한 자원 낭비를 감소시키기 위한 것이다.
- Web Workers는 브라우저 자체의 기능으로 자바스크립트와는 거의 관계가 없다.
📄 답지
- ES7에서 사용 가능
- Shared Workers survive the termination of a port connection if other port connections are still alive, whereas dedicated Workers are terminated whenever the connection to their initiating program is terminated.
- Because a shared Worker can be connected to or from more than one program instance or page on your site, the Worker needs a way to know which program a message comes from. This unique identification is called a "port" -- think network socket ports. So the calling program must use the
**port
object of the Worker for communication:**
`w1.port.addEventListener( "message", handleMessages );
// ..
w1.port.postMessage( "something cool" );`
-
If your site or app allows for loading multiple tabs of the same page (a common feature), you may very well want to reduce the resource usage of their system by preventing duplicate dedicated Workers; the most common limited resource in this respect is a socket network connection, as browsers limit the number of simultaneous connections to a single host.
-
All these are great questions to consider as we explore a feature added to the web platform circa HTML5 called "Web Workers." This is a feature of the browser (aka host environment) and actually has almost nothing to do with the JS language itself. That is, JavaScript does not currently have any features that support threaded execution.
- Structured Cloning Algorithm
- Transferable Objects
- Serializing all data to a string value
📄 답지
-
"Structured Cloning Algorithm" (https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm) is used to copy/duplicate the object on the other side. This algorithm is fairly sophisticated and can even handle duplicating objects with circular references. The to-string/from-string performance penalty is not paid, but we still have duplication of memory using this approach. There is support for this in IE10 and above, as well as all the other major browsers.
-
"Transferable Objects" (http://updates.html5rocks.com/2011/12/Transferable-Objects-Lightning-Fast). What happens is that the object's "ownership" is transferred, but the data itself is not moved. Once you transfer away an object to a Worker, it's empty or inaccessible in the originating location -- that eliminates the hazards of threaded programming over a shared scope. Of course, transfer of ownership can go in both directions.
-
You may notice a common characteristic of most of those uses, which is that they require a large amount of information to be transferred across the barrier between threads using the event mechanism, perhaps in both directions.
답없음
yujo
- asm.js는 모든 타입을 다룰 수 있다. (O / X)
- asm.js는 JavaScript에 기반한 공식 스펙이다. (O / X)
- asm.js는 지속적으로 업데이트 되고 있다. (O / X)
📄 답지
- X / 숫자 타입만 다룰 수 있다.
- X / asm.js는 JavaScript에 기반한 비공식 스펙이다.
- X / 2014년을 끝으로 Depreacte 되었다.