c++ - Using std::thread or CreateThread()? -
this question has answer here:
i revising codes when doing project developed when started coding in c/c++.
it's threading. in tutorials read (which 2006) said that, when developing windows, 1 use createthread() create threads. using function better using std::thread?
is faster also?
in applications load crt (as c/c++ are) can't use createthread
, per spec:
a thread in executable calls c run-time library (crt) should use
_beginthreadex
,_endthreadex
functions thread management rather createthread , exitthread; requires use of multithreaded version of crt. if thread created using createthread calls crt, crt may terminate process in low-memory conditions.
std::thread
on other hand right thing.
Comments
Post a Comment