[fpc-devel] C++ gets language-internal concurrency support
Michael Schnell
mschnell at lumino.de
Wed Aug 17 15:59:11 CEST 2011
Some c++11 code doing parallel execution:
*
void f(vector<double>&);
struct F {
vector<double>& v;
F(vector<double>& vv) :v{vv} { }
void operator()();
};
int main()
{
std::thread t1{std::bind(f,some_vec)}; //*f(some_vec) executes in separate thread*
std::thread t2{F(some_vec)}; //*F(some_vec)() executes in separate thread*
t1.join();
t2.join();
}
*
*-Michael*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20110817/14c933b6/attachment.html>
More information about the fpc-devel
mailing list