taenyLog
비동기식 JavaScript 본문
THE CALL STACK
함수의 호출을 스택 방식으로 기록하는 자료구조이다. 프로그램에서 요청이 들어올 때마다 순차적으로 호출 스택에 담아 처리한다. 자바스크립트는 단일쓰레드(Single Thread) 프로그래밍 언어이다. 즉 , 한번에 하나의 단일 호출 스택(Single Call Stack)을 가지고 있어서, 하나의 작업(Task)만 처리할 수 있다.
The mechanism the JS interpreter uses to keep track of its place in a script that calls multiple functions.
How JS " knows" what function is currently being run and what functions are caled from within that function, etc.
How it works
when a script calls a function, the interpreter adds it to the call stack and then stars carrying out the function.
Any functions that are called by that function are added to the call stack further up, and run where their calls are reached.
When the current function is finished, the interpreter takes it off the stack and resumes execution where it left off in the last code listing
loupe 사이트에서 콜스택 시각화 확인
'Web' 카테고리의 다른 글
CALL BACK HELL (0) | 2023.06.13 |
---|---|
WebAPI와 단일 스레드 (0) | 2023.06.13 |
유데미 웹개발 부트캠프 2023 | section 26 : 점수 관리자 제작하기(feat. Bulma) / 코드 리팩토링 (1) | 2023.06.13 |
유데미 웹개발 부트캠프 2023 | section 26 : 점수 관리자 제작하기(feat. Bulma) (0) | 2023.06.13 |
Bulma사용하기 (0) | 2023.06.11 |