Folly Code Review
folly::coro::Task — lazy single-shot 코루틴
Task<T>의 lazy start, executor 바인딩, scheduleOn, 값/예외 전파 — production async의 기본 단위.
· 4분 읽기
cpp folly
8개의 포스트
Task<T>의 lazy start, executor 바인딩, scheduleOn, 값/예외 전파 — production async의 기본 단위.
folly::coro의 위치 — std 코루틴 위에 Task/AsyncGenerator/Mutex를 쌓아 production async를 가능하게 한 이유.
Part 10-04: fibers::Channel — fiber 간 producer/consumer 채널. Go의 channel과 비슷한 sync 점.
InlineExecutor는 add()의 caller thread에서 callback을 그 자리에서 실행한다. 테스트와 단축 경로에 적합하지만 production hot path에는 위험하다.
Folly fibers는 boost.context 기반 stackful coroutine. 동기 코드처럼 쓰고 비동기로 동작하는 M:N 모델.
SemiFuture는 executor에 바인딩되지 않은 상태, Future는 바인딩 완료 상태. 이 구분이 라이브러리 API의 안전성을 만든다.
folly::Promise로 비동기 완료를 표현하고, makeFuture/makeSemiFuture로 이미 결정된 값을 Future 인터페이스에 올린다.
folly::Future가 std::future의 어떤 한계를 해결하는가 — continuation, executor binding, exception 전파.