Giter VIP home page Giter VIP logo

Comments (6)

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024
  • Multithreading: 그냥 스레드 여러개 만들 수 있으면 끝. 하지만 이게 과연 Concurrency 일지 Sequential 일지는 모름.
  • Concurrency: 여러 계산을 동시에 수행할 수 있음. 다만 CPU 코어 여러개에서 수행된다는 보장은 없음. (OS 스케쥴링?)
  • Concurrent multithreading: 런타임에 여러개의 쓰레드가 run in overlapping time periods, 즉 같은 시간에 동시에 실행될 수 있는 것.
  • Sequential multithreading: GIL 로 인해서 프로그램이 만든 쓰레드가 런타임에 딱 하나만 실행 가능. 따라서 parallel 하지 않음.
  • Parallelism: 어떤 계산이 여러개의 CPU 코어에서 동시에 수행될 수 있음.

from sangwoo-joh.github.io.

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024
  • 모든 GC 언어가 GIL을 갖고 있진 않다 (e.g. Java)
  • System thread는 OS가 스케쥴링 한다. 예측하기 어렵다.
  • OCaml native code에서는 allocator랑 상호작용하기 전까지는 GIL을 안놓는다: 이말은 object를 안만드는 함수는 끝까지 수행된다는 뜻. Bytecode는 그런거 없다.

from sangwoo-joh.github.io.

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024

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.

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024

https://github.com/ocaml-multicore/effects-examples

from sangwoo-joh.github.io.

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024

Ocaml GIL: https://github.com/ocaml/ocaml/blob/4.12/otherlibs/systhreads/threads.h#L28-L51

from sangwoo-joh.github.io.

sangwoo-joh avatar sangwoo-joh commented on July 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.