fork 한 저장소을 글을 번역하였다.
- C++11은 표준 스레딩 라이브러리로 Boost 스레딩 라이브러리를 도입했고, 저자 Anthony Williams는 2012년에 *C++ Concurrency in Action*을 출간하여 그 기능을 소개했습니다. C++17에 대응하여 2019년 2월에 2판을 출간했습니다. C++ Concurrency in Action 2ed 첫 5장에서는 스레드 지원 라이브러리를 소개합니다. cppreference.com/w/cpp/thread), 마지막 여섯 장에서는 실용적인 관점에서 동시 프로그래밍의 설계 아이디어를 소개하고, [std::scoped_lock](https://en.cppreference.com/w/cpp/. thread/scoped_lock](https://en.cppreference.com/w/cpp/thread/shared_mutex), std::shared_mutex, C++17 표준 라이브러리 병렬 알고리즘에 대한 추가 장(10장)을 포함합니다. en.cppreference.com/w/cpp/header/execution), std::jthread와 같은 C++20 관련 기능을 개인적으로 추가했습니다. , std::counting_semaphore, std::barriers를 추가했습니다. /w/cpp/thread/barrier), std::latch 등이 있습니다. 이 책을 읽기 전에 현대 운영체제에 대한 Andrew S. Tanenbaum을 참고하세요. subject/25864553/)에서 운영체제의 기초([프로세스와 스레드](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/docs/reference/ processes_and_threads.md), 교착 상태, 메모리 관리, 파일 시스템, [I/O](https://github. com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/docs/reference/IO.md) 등). 이는 참고용 개인 메모이며 자세한 내용은 원서를 참조하세요.
- 스레드 관리: < thread>
- 스레드 간 데이터 공유 between_thread.md): <mutex>, <shared_mutex> CPP/헤더/공유_뮤텍스)
- [동시 작업 동기화](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/docs/03_ synchronising_concurrent_operation.md): <조건_변수>, < 세마포어>, <barrier>, <latch>, <future>, <chrono >, <비율>
- C++ 메모리 모델과 원자형에 대한 연산 master/docs/04_the_cpp_memory_model_and_operations_on_atomic_type.md): <atomic>
- [잠금 기반 동시 데이터 구조 설계하기] (https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/) master/docs/05_designing_lock_based_concurrent_data_structure.md)
- [잠금 없는 동시 데이터 구조 설계](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/ docs/06_designing_lock_free_concurrent_data_structure.md)
- [동시 코드 설계](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/docs/07_designing_ concurrent_code.md)
- [고급 스레드 관리](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/master/docs/08_advanced_thread _management.md)
- 병렬 알고리즘 (병렬 알고리즘): . <실행>
- [멀티 스레드 애플리케이션 테스트 및 디버깅 (多线程应用的测试与调试)](https://github.com/downdemo/Cpp-Concurrency-in-Action-2ed/blob/ master/docs/10_testing_and_debugging_multithreaded_application.md)
헤더 | 설명 |
---|---|
<thread>, [<stop_token>](https://en.cppreference.com/w/cpp/header/stop_ 토큰) | 스레드 |
<mutex>, [<shared_mutex>](https://en.cppreference.com/w/cpp/header/shared_ mutex) | 잠금 |
<조건_변수> | 조건_변수 |
<세마포어> | 신호 수량 |
<barrier>, <latch> | barrier |
<미래> | 비동기 처리 결과 |
<chrono> | clock |
<비율> | 컴파일 기간 유리수 산술 |
<원자> | 원자형과 원자 연산 |
<실행> | 표준 라이브러리 알고리즘 실행 정책 |
특성 | API |
---|---|
thread | std::thread |
mutex | std::mutex、std::lock_guard、std::unique_lock |
condition variable | std::condition_variable、std::condition_variable_any |
atomic | std::atomic、std::atomic_thread_fence |
future | std::future、std::shared_future |
interruption | 없음 |
특성 | API |
---|---|
thread | boost::thread |
mutex | boost::mutex、boost::lock_guard、boost::unique_lock |
condition variable | boost::condition_variable、boost::condition_variable_any |
atomic | 없음 |
future | boost::future、boost::shared_future |
interruption | thread::interrupt |
특성 | API |
---|---|
thread | pthread_create、pthread_detach、pthread_join |
mutex | pthread_mutex_lock、pthread_mutex_unlock |
condition variable | pthread_cond_wait、pthread_cond_signal |
atomic | 없음 |
future | 없음 |
interruption | pthread_cancel |
특성 | API |
---|---|
thread | java.lang.Thread |
mutex | synchronized blocks |
condition variable | java.lang.Object.wait、java.lang.Object.notify |
atomic | volatile、java.util.concurrent.atomic |
future | java.util.concurrent.Future |
interruption | java.lang.Thread.interrupt |
스레드 안전 컨테이너 | java.util.concurrent 컨테이너 |
스레드 풀 | java.util.concurrent.ThreadPoolExecutor |