반응형

프로그래밍/Parallel Programming 12

병렬 프로그래밍 Parallel Programming - run-with-cancellation-token

이전 정리글 2022.01.05 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - task cancel 병렬 프로그래밍 Parallel Programming - task cancel 이전 정리글은 2022.01.05 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - cancellation_token 특성 병렬 프로그래밍 Parallel Programming - cancellation_token 특성 이전 정리.. nanze.tistory.com 이번 포스팅에 정리할 대상은 run_with_cancellation_token 이다. run_with_cancellation_tok..

병렬 프로그래밍 Parallel Programming - task cancel

이전 정리글은 2022.01.05 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - cancellation_token 특성 병렬 프로그래밍 Parallel Programming - cancellation_token 특성 이전 정리글 2022.01.03 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - cancellation_token 병렬 프로그래밍 Parallel Programming - cancellation_token 이전 정리글은 2022.01.. nanze.tistory.com 이번 정리에는 cancellation_token 아 아닌 task 클래스 또는 task_..

병렬 프로그래밍 Parallel Programming - cancellation_token 특성

이전 정리글 2022.01.03 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - cancellation_token 병렬 프로그래밍 Parallel Programming - cancellation_token 이전 정리글은 2022.01.03 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - concurrent_unordered_map 지난 포스팅에 이어 ppl 에서 제공하는 task 들을 취소할 수 있는 방법을 알.. nanze.tistory.com 오늘은 이전 정리에서 알아본 cacellation_token 의 특성을 알아보자. concurrency::cancellatio..

병렬 프로그래밍 Parallel Programming - cancellation_token

이전 정리글은 2022.01.03 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - concurrent_unordered_map 병렬 프로그래밍 Parallel Programming - concurrent_unordered_map 이전 정리글은 2021.12.30 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - concurrent_vector 자 오늘은 일곱번째 정리시간이다. 호랑이해 들어 첫 포스팅이다. 이번 해에는 호랑.. nanze.tistory.com 지난 포스팅에 이어 ppl 에서 제공하는 task 들을 취소할 수 있는 방법을 알아보자. 개발 공부를 처음 접하거나..

병렬 프로그래밍 Parallel Programming - concurrent_unordered_map

이전 정리글은 2021.12.30 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - concurrent_vector 자 오늘은 일곱번째 정리시간이다. 호랑이해 들어 첫 포스팅이다. 이번 해에는 호랑이 기운 받아 모든 일이 힘차게 잘 나아가서 순조롭게 풀렸으면 한다. 방문하신 모든 분들도.~! 첫번째로 알아볼 것은 이전시간에 다른 자료구조이다. 병렬 멀티셋을 알아보자. concurrency::concurrent_unordered_multiset 해당 자료구조는 중복 값을 가질 수 있는 set 이라고 생각하면 된다. 코드를 보자. #include #include #include using namespace std; int main() { co..

병렬 프로그래밍 Parallel Programming - concurrent_vector

이전 정리글은 2021.12.28 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - parallel_sort 오늘은 7번째 정리시간이다. 오늘은 무엇에 대해서 정리해볼까.? 오늘은 PPL 에서 제공하는 컨테이너에 대해서 정리해보자. 먼저 알아볼 것은 vector 에 대해서 알아보자. concurrency::concurrent_vector 우리가 알고 있는 STL vector 와 동일한 것이다. 하지만 차이가 있다. 병행 프로그래밍에서 사용할 수 있는 컨테이너이기에 제공하는 몇개의 함수에 대해서 thread-safe 를 보장한다. 그럼 어떤 함수들이 thread-safe 한지 알아보자. 함수 thread-safe 함수 thread-safe ..

병렬 프로그래밍 Parallel Programming - parallel_sort

이전 정리글은 2021.12.26 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - parallel_invoke 자. 오늘은 병렬 방식을 이용한 정렬 함수에 대해 알아보자. 첫번째로 알아볼 함수는 parallel_sort 함수이다. 해당 함수는 std::sort 함수의 다중 프로세스 버전이라고 생각하면 될 것 같다. 자 코드를 보자구~!! #include #include #include using namespace std; int _tmain() { vector vecIntegers(100000); generate(begin(vecIntegers), end(vecIntegers), mt19937(79)); concurrency::paral..

병렬 프로그래밍 Parallel Programming - parallel_invoke

이전 정리글은 2021.12.22 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - parallel_for 메리 크리스마스. ~! 예전에는 크리스마스 때 설렘이 있었는데 나이를 먹었나보다. ㅜㅜ 자 오늘은 parallel_invoke 에 대해서 정리해보자구~ parallel_invoke 이 함수는 여러개의 작업을 동시에 실행하고자 다룰 때 유용하다. 언제나 그랬듯이 코드를 보자 ㅎ,.ㅎ #include #include #include using namespace std; template T addself(const T& p) { return p + p; } int _tmain() { int i = 12; short j = 15; doubl..

병렬 프로그래밍 Parallel Programming - parallel_for

이전 정리글은 2021.12.20 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - task_group 4번째 병렬 프로그래밍 관련 정리 시간이다. 오늘은 PPL 에서 제공하는 함수 중 parallel_for 에 대해서 알아보자.! parallel_for parallel_for 함수는 인자의 함수가 수행하는 작업이 병렬적으로 수행된다고 생각하면 된다. 몇 개의 스레드가 ? 몇 구간을 나눠서 ? 이런 것은 생각할 필요가 없다. 내부 구현부에서 최적화된 방식으로 작업을 수행한다고 한다. 음.. 이 함수가 쓰이는 곳은 병렬적으로 이루어져야 하는 작업이 데이터를 공유하지 않고 수행될 수 있을 때 유리할 것 같다. 자 코드를 보자. #include..

병렬 프로그래밍 Parallel Programming - task_group

이전 정리글은 2021.12.18 - [프로그래밍/Parallel Programming] - 병렬 프로그래밍 Parallel Programming - when_all, when_any 자 ~! 오늘은 3번째 정리시간이다. 오늘은 task_group 과 structed_task_group 에 대해서 정리해보자. 이 두 클래스는 task를 그룹으로 관리하기 편한 기능을 제공한다. 하나씩 알아가보자.! structed_task_group 우선 structed_task_group 에 대해서 알아보자. 일단 모다? 코드부터 ㅋ #include #include int _tmain() { auto taskone = concurrency::make_task( []{ wcout

반응형