JavaScript의 Atomic 개체는 정적 메서드로 add, sub, or, xor, load, store 등과 같은 원자적 연산을 제공하는 개체이며 이러한 메서드는 SharedArrayBuffer 개체와 함께 사용됩니다.
이 메서드는 잠금을 사용할지 원자적 연산을 사용할지 결정하는 데 사용됩니다.
구문
구문은 다음과 같습니다.
Atomics.isLockFree(size)
예시
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script>
document.write(Atomics.isLockFree(7));
document.write("<br>");
document.write(" "+Atomics.isLockFree(8));
</script>
</body>
</html> 출력
false false