On Wed, 17 Aug 2011 16:24:35 +0200 (CEST), Marco van de Voort wrote about Re: [fpc-devel] C++ gets language-internal concurrency support:
> In our previous episode, Michael Schnell said: [snip] >> 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(); >> } > > I'm no C++ expert, but: I am (reasonably so, at least). > Where is the parallel aspect? The threads t1 and t2 execute in parallel. Moreover, they will execute in parallel with any code that occurs between the declaration that start the threads and the join() method calls that synchronize them with the invoking thread. On a SMP system they will execute physically in parallel, not simply timesliced against one another. The underlying implementation model is that of POSIX threads. This is tantamount to the TThread class (e.g. from Borland C++) becoming part of the C++ Standard Template Library (STL). It is nothing particularly new or special, but at least the C++ standard now acknowledges concurrent execution and its need for reentrancy. -- Regards, Dave [RLU #314465] *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* david.w.n...@ntlworld.com (David W Noon) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
signature.asc
Description: PGP signature
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel