A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Atomics/notify below:

Atomics.notify() - JavaScript | MDN

Atomics.notify()

Baseline Widely available

Atomics.notify() 정적 메서드는 대기열에서 대기 중인 있는 일부 에이전트에게 알림을 보냅니다.

참조: 이 작업은 공유된 Int32Array에서만 작동합니다. 공유되지 않은 ArrayBuffer 객체에서는 0을 반환합니다.

구문
Atomics.notify(typedArray, index, count)
매개변수
typedArray

공유된 Int32Array.

index

깨울 typedArray의 위치.

count Optional

알림을 보낼 대기 중 에이전트의 숫자. 기본 값은 +Infinity입니다.

반환 값 예외 예제 notify 사용하기

공유된 Int32Array에서

const sab = new SharedArrayBuffer(1024);
const int32 = new Int32Array(sab);

읽기 스레드는 0이 될 것으로 예상되는 위치 0에서 대기 중입니다. 이 상태가 유지되는 한 계속 진행되지 않습니다. 그러나 쓰기 스레드가 새 값을 저장하면 쓰기 스레드에서 알림을 받고 새 값(123)을 반환합니다.

Atomics.wait(int32, 0, 0);
console.log(int32[0]); // 123

쓰기 스레드는 새로운 값을 저장하고 쓰기가 완료되면 대기 중인 스레드에 알립니다.

console.log(int32[0]); // 0;
Atomics.store(int32, 0, 123);
Atomics.notify(int32, 0, 1);
명세서 브라우저 호환성 같이 보기

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4