Reshmi, the simplest meaningful example that I was able to come up with was the one I wrote for the pthreads article I have on this page: http://blog.emptycrate.com/node/270.
However, I don't recommend using pthreads in C++. It has several disadvantages, mostly in that it was written to work with C more than C++, so you must use a static or global function to launch your C++ code. The pthreads article linked above describes that in more detail.
I strongly recommend using a higher level abstraction such as boost::threads as this article describes or building or using some even higher level abstraction.
Recent comments
4 weeks 3 days ago
7 weeks 9 hours ago
7 weeks 4 days ago
8 weeks 9 hours ago
8 weeks 9 hours ago
8 weeks 9 hours ago
9 weeks 5 days ago
10 weeks 5 days ago
12 weeks 6 days ago
12 weeks 6 days ago