> is there any way to use threads in c++
the ISO standards committee (c++09) has voted voted in a number of concurrency extensions into the working draft (memory model, atomics library, basic threads, locks, and condition variables). an asynchronous future<T> type would be added later, but features like thread pools are deferred.
http://www.open-std.org/jtc1/sc22/wg...007/n2320.html
the Boost.Thread library has been rewritten to align with c++09 proposals.
http://www.boost.org/doc/libs/1_35_0...ml/thread.html
> Is it common for "everyday" applications (in todays multicore platforms) to use threads?
in windows, probably yes. threads have been widely used over the years.
in unix, probably no. fork is very efficient.
most of the push towards concurrency seems to be in the kernel (solaris, bsd), filesystems (zfs) and libc ( bsd's gemalloc, google's tcmalloc) right now.
opinion seems to be divided; here are two extremes:
I won’t be surprised at all if the whole multithreading idea turns out to be a flop, worse than the "Itanium" approach that was supposed to be so terrific—until it turned out that the wished-for compilers were basically impossible to write.
Let me put it this way: During the past 50 years, I’ve written well over a thousand programs, many of which have substantial size. I can’t think of even five of those programs that would have been enhanced noticeably by parallelism or multithreading. - Donald Knuth
http://www.informit.com/articles/article.aspx?p=1193856
Concurrency is the next major revolution in how we write software
Applications will increasingly need to be concurrent if they want to fully exploit continuing exponential CPU throughput gains. - Herb Sutter
http://www.gotw.ca/publications/concurrency-ddj.htm
> sources for threaded programming.
a great book: Java Concurrency in Practice by Brian Goetz
http://www.javaconcurrencyinpractice.com/
two other good books:
Patterns for Parallel Programming by Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill
http://www.amazon.com/Patterns-Paral.../dp/0321228111
The Art of Multiprocessor Programming by Maurice Herlihy, Nir Shavit
http://www.amazon.com/gp/product/0123705916