
회사에서 발표했던 자료 😎 시연한 예제 코드 generator // feature1 ) pause - resume function* sampleGen(){ console.log('함수를 시작합니다') x = yield 1; console.log(`여기서부터 함수를 다시 시작해요. input = ${x}`) y = yield 2; console.log(`다시 시작~ ${y}`) } const gen1 = sampleGen() gen1.next() gen1.next(5) gen1.next(6) // feature2 ) iterator function* sampleGen2(){ for (let i=1; i coroutine (지역 변수 및 pc 값을 저장할 수 있는 초경량 실행 유닛) ---> async/aw..

파이썬 비동기 프로그램을 위한 문법은 어떻게 될까? 아래에 잘 정리된 문서가 있었다. 한번 알아보자 🐲 speed up your python program with concurrency python concurrency method : threading vs asyncio vs multiprocessing thread, task, process 세가지 모두 => sequence of instructions that run in order high level에서 본다면 세가지 모두 다음과 같은 공통점이 있음 : cpu에서 실행하고, 중간 상태를 저장하고 멈췄다가 나중에 그 지점부터 다시 실행할 수 있는 instruction+메타 데이터 묶음(?)이라는 것. 그렇지만 multiprocessing만 진짜로 시..

관련 있는 이전 발행글 2021.03.23 - [언어와 프레임워크/javascript] - 반복문 비동기 처리 ( + Event Loop, Promise ) 2021.11.29 - [이론/동시성모델] - 서버는 여러개의 request를 어떻게 감당할까? 2022.02.02 - [이론/동시성모델] - [문서정리] I/O Bound 서버를 스케일링 하기 위한 리액터 패턴 참고자료 server architecture (thread-base, event-base, SEDA) Performance and scalability analysis of Java IO and NIO based server models, their implementation and comparison 1) thread-based serve..

=> 이거 완전 그냥 노드 얘기임 😎 👾 ⬇️ Reactor Pattern for Scaling I/O Bound Server 아이유가 당신의 플랫폼으로 팬들과 소통하겠다고 얘기해서 엄청나게 유명해진 채팅 서버를 운영해야 하는 상황이라고 가정해보자. 당신은 10K 정도의 동시 접속이 이루어지고 있다는 것을 깨달았다. 1개의 단순한 서버라면 이것을 어떻게 핸들링 할까? 두가지 측면에서 생각해 볼 수 있다. - 싱글 스레드를 써야 할까 멀티스레드로 해야 할까? 프로세스는 싱글? 멀티? - 어떤 reading 매커니즘을 서야 할까? Blocking IO? Non-Blocking IO? 아니면 Demultiplexer? (참고) * 아래의 5 IO model을 적용하며 읽어보세요~ 🌹🌻🌸 ⬇️ blocking ..

👾아래 문서 정리 ⬇️ https://engineering.universe.com/introduction-to-concurrency-models-with-ruby-part-ii-c39c7e612bed Introduction to Concurrency Models with Ruby. Part II In the second part of our series we will take a look at more advanced concurrency models such as Actors, CSP, STM and of course Guilds engineering.universe.com 파트2에서는 Actor, CSP, STM, Guild 같은 심화된 동시성 모델을 살펴볼 것이다. 야호 😎💃 🐶 Actor Acto..

👾 아래 문서 정리 ⬇️ https://engineering.universe.com/introduction-to-concurrency-models-with-ruby-part-i-550d0dbb970 Introduction to Concurrency Models with Ruby. Part I In this first post, I would like to describe the differences between Processes, Threads, what the GIL is, EventMachine and Fibers in Ruby. engineering.universe.com 🐶 프로세스 concurrency => 한사람이 한손으로만 여러개의 공을 저글링하고 있는 것. 어떻게 보이든지 간에 이 사람은..

먼저 시작하기 전에 다음의 글(Implementing threads)을 배경 지식으로 같이 깔고 가면 좋겠다. yield하면 생산이라는 뜻이 먼저 떠올라서 의미가 잘 안 와닿았는데, 멀티스레딩 관점에서는 양보라는 다른 뜻으로 해석하는게 더 잘 맞는 것 같다. running 스레드가 다른 스레드로 실행을 양보하는 것! In computer science, yield is an action that occurs during multithreading, of forcing a processor to relinquish control of the current running thread, and sending it to the end of the running queue, of the same schedulin..

👾 아래 문서 정리 ⬇️ http://www.it.uu.se/education/course/homepage/os/vt18/module-4/implementing-threads/ 스레드 라이브러리는 개발자가 스레드를 생성하고 관리할 수 있도록 하는 API를 제공한다. 커널 레벨 스레드 os에서 직접 제공하고 관리하는 스레드. 1 PCB/ 1 process 그리고 1 TCB/ 1 thread. 유저 레벨에서 스레드를 생성하고 관리할 수 있도록 시스템 콜을 제공한다. 🧸 장점 => 커널이 모든 스레드에 대한 정보를 알고 있다. 따라서 스케줄러가 더 많은 수의 스레드를 가지고 있는 프로세스에게 더 많은 cpu 타임을 할당하도록 할 수 있다. 자주 block 되는 어플리케이션의 경우에는 이 방식이 더 좋다. ( ..