C++11 4

[C++ 11] 정규 표현식 std::regex (2)

https://donot-simsim.tistory.com/50 [C++ 11] 정규 표현식 std::regex (1) https://en.cppreference.com/w/cpp/regex Regular expressions library (since C++11) - cppreference.com Regular expressions library The regular expressions library provides a class that represents regular expressions, which are a kind of mini-language used to donot-simsim.tistory.com 정규식에 관한 간단한 문법은 위에. C++ regex에서는 정규식을 가지고 간단하게 사용..

C++/기타 2023.04.23

[C++] std::async, std::thread (2)

https://donot-simsim.tistory.com/35 [C++] std::async, std::thread (1) 둘 다 비동기 작업을 수행하기 위해 만드는 것은 동일. 다만 몇 가지의 차이는 있다. 쓰면서 가장 와닿았던 두 가지의 특성이 있는데, 1. std::thread는 그저 thread를 하나 만들 뿐이다. 그에 관한 관 donot-simsim.tistory.com 여기서 이어지는 두 번째. 2. std::thread는 해당 함수를 통해 값을 가져오는 건 좀 귀찮아서, 주로 watchdog 같은 곳에 사용하게 되더라. 반면 std::async는 만드는 순간 future object를 되돌려주기 때문에, 해당 함수에서 값을 얻어오는 대에 특화되어있다. 이번엔 두 번쨰. async 는 th..

C++/STL 2023.04.10

[C++] std::async, std::thread (1)

둘 다 비동기 작업을 수행하기 위해 만드는 것은 동일. 다만 몇 가지의 차이는 있다. 쓰면서 가장 와닿았던 두 가지의 특성이 있는데, 1. std::thread는 그저 thread를 하나 만들 뿐이다. 그에 관한 관리는 직접 해야한다. 반면에 std::async는 자체 thread pool을 가지고 있어 관리에 대해서는 좀 놓아도 상관없다. 2. std::thread는 해당 함수를 통해 값을 가져오는 건 좀 귀찮아서, 주로 watchdog 같은 곳에 사용하게 되더라. 반면 std::async는 만드는 순간 future object를 되돌려주기 때문에, 해당 함수에서 값을 얻어오는 대에 특화되어있다. 여기에선 첫 번째에 관해서만 확인해보자. #include #include void func() { std:..

C++/STL 2023.04.09
반응형