How do I start to use multithread programming?
Learning multi threading programming has two parts:
- How to write multi threading applications
- How to use the available API (pthread)
Learning multi-threaded programming is harder, thre's a good article published in the Linux Journal that will help you understand the basic principles.
To better understand pThreads I suggest reading this tutorial - POSIX Threads Programming
There is also a good book by O'rielly called PThreads Programming
Study regarding pthread, mutexes and try to implement same that will be beneficial for you.
http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
If you're getting started with multithreading, my advice would be to first review and better understand I/O on your system. Understand blocking vs. non-blocking I/O, signaling, asynchronous routines, callbacks et cetera. I/O is probably one, if not the primary, reason for adding multithreading to your programs. With that knowledge you can then pick up a book on pthreads or java threads, or wrap your mind around the Boost threads library or another threading library for your favorite technology.