Comments (6)
- Multithreading: 그냥 스레드 여러개 만들 수 있으면 끝. 하지만 이게 과연 Concurrency 일지 Sequential 일지는 모름.
- Concurrency: 여러 계산을 동시에 수행할 수 있음. 다만 CPU 코어 여러개에서 수행된다는 보장은 없음. (OS 스케쥴링?)
- Concurrent multithreading: 런타임에 여러개의 쓰레드가 run in overlapping time periods, 즉 같은 시간에 동시에 실행될 수 있는 것.
- Sequential multithreading: GIL 로 인해서 프로그램이 만든 쓰레드가 런타임에 딱 하나만 실행 가능. 따라서 parallel 하지 않음.
- Parallelism: 어떤 계산이 여러개의 CPU 코어에서 동시에 수행될 수 있음.
from sangwoo-joh.github.io.
- 모든 GC 언어가 GIL을 갖고 있진 않다 (e.g. Java)
- System thread는 OS가 스케쥴링 한다. 예측하기 어렵다.
- OCaml native code에서는 allocator랑 상호작용하기 전까지는 GIL을 안놓는다: 이말은 object를 안만드는 함수는 끝까지 수행된다는 뜻. Bytecode는 그런거 없다.
from sangwoo-joh.github.io.
https://speakerdeck.com/kayceesrk/multicore-ocaml-whats-coming-in-2021
- Parallelism is not Concurrency
- Parallelism is a performance hack, whereas concurrency is a program structuring mechanism
- e.g. Lwt and Async are concurrent programming libraries
from sangwoo-joh.github.io.
https://github.com/ocaml-multicore/effects-examples
from sangwoo-joh.github.io.
Ocaml GIL: https://github.com/ocaml/ocaml/blob/4.12/otherlibs/systhreads/threads.h#L28-L51
from sangwoo-joh.github.io.
https://www.youtube.com/watch?v=mCD6VLVS_y4&t=1181s
- fork: clone + memory copy
- thread: clone + shared memory
- async: callback, message queue + threads pool, but callback hell
- coroutine: callback, async/await/yield/generator, organized like synchronous code
- fiber: a userland thread, scheduled cooperately. organized as coroutine + manager + scheduler
from sangwoo-joh.github.io.
Related Issues (20)
- Cheap option (unboxed option optimization)
- PCRE
- Chomsky Hierarchy
- Django Models (ORM)
- Functor vs. Comparator style container HOT 1
- Algebraic Effects and Handlers HOT 1
- Type, Memory Layout, Garbage Collection and Parallelism HOT 2
- Toy Project Idea HOT 13
- Ecaml tutorial HOT 1
- 의미없는 <ul> 지우기
- WSL 2 + emacs 28
- Top in Life
- mmap
- Story
- 내가 보려고 정리하는 멀티코어 OCaml 목차
- migrate to org
- doomemacs HOT 3
- org로 jekyll 블로깅하기
- updated / new 태그 끌어올리기 HOT 1
- xxxx년에 OCaml 프로젝트 템플릿 생성하기
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sangwoo-joh.github.io.