Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2021년 12월.
* Some parts of this feature may have varying levels of support.
SharedArrayBuffer 객체는 제네릭, 고정된 길이의 원시 바이너리 데이터 버퍼를 표현하는데 사용됩니다. ArrayBuffer 객체와 유사하지만, 공유된 메모리상의 뷰를 생성하는데 사용될 수 있습니다. ArrayBuffer 와는 달리, SharedArrayBuffer 는 분리될 수 없습니다.
참고 : Spectre 에대한 응답으로 2018년 1월 5일에 SharedArrayBuffer 는 모든 주요 브라우저에서 기본적으로 비활성화되어있음을 참고하세요. Chrome 은 사이트 격리 기능을 사용하여 Spectre 스타일 취약점으로부터 보호될 수 있는 플랫폼상의 v67 에서 이를 다시 활성화하였습니다.
생성할 array buffer 의 바이트 크기.
크기가 지정된 새로운 SharedArrayBuffer 객체입니다. 컨텐츠는 0 으로 초기화됩니다.
SharedArrayBuffer 객체를 사용해 메모리를 하나의 agent(agent 는 웹 페이지의 메인 프로그램 또는 웹 워커 중 하나입니다)와 다른 agent 에서 공유하기 위해, postMessage 와 structured cloning 이 사용됩니다.
Structured clone 알고리즘은 SharedArrayBuffer 와 SharedArrayBuffer 상에 맵핑된 TypedArray 를 받아들입니다. 이 두 경우에서, SharedArrayBuffer 객체는 수신자(receiver)에게 전달되어 수신 agent(예, ArrayBuffer)의 새로운 비공개의 SharedArrayBuffer 객체를 생성합니다. 하지만, 두 SharedArrayBuffer 에 의해 참조되는 공유 데이터 블록은 같은 블록이며, 부수적인 효과로, 하나의 agent 가 다른 agent 에서 보이게 됩니다.
공유 메모리는 워커나 메인 스레드에서 동시에 수정 및 생성할 수 있습니다. 시스템(CPU, OS, 브라우저)에따라 변경사항이 전체 컨텍스트로 전파될때까지 약간의 시간이 필요합니다. 동기화를 위해선, atomic 연산이 필요합니다.
SharedArrayBuffer 생성자는 생성될 때, new 연산자를 필요로 합니다. SharedArrayBuffer 생성자를 new 없이 함수로써 호출하면, TypeError 를 일으킬 것 입니다.
값이 1인 SharedArrayBuffer 생성자의 length 속성입니다.
SharedArrayBuffer.prototype모든 SharedArrayBuffer 객체에 프로퍼티 추가를 가능하게 해줍니다.
모든 SharedArrayBuffer 인스턴스는 SharedArrayBuffer.prototype 를 상속합니다.
배열의 크기 (바이트)입니다. 이것은 배열이 구성 될 때 설정되며 변경할 수 없습니다. 읽기 전용입니다.
Returns a new SharedArrayBuffer whose contents are a copy of this SharedArrayBuffer's bytes from begin, inclusive, up to end, exclusive. begin 또는 end 중 하나가 음수이면 처음부터가 아니라 배열 끝의 인덱스를 참조합니다.
| ECMAScript® 2027 Language Specification # sec-sharedarraybuffer-objects |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 9일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.