Using your Pi 2 Model B With Threads

Now that the Pi 2 model B is a quad-processor, you might decide to start using threads to try to obtain optimum performance. Of course you have always been able to use threads but can now take advantage of multiple processors. I started programming threads in a multi-processor environment back in the mid-90s using OS/2. OS/2 was unfairly associated with the phrase "half an OS" but it was better than any other conventional PC operating system at the time. I was using threads in a program that communicated with hardware that sent its positional information over two serial links to a program that took the input for each axis and calculated the area being traced. The two books on threads shown here were very helpful at the time and, though now out of print, are still available second hand.

Threads Primer - ISBN 0134436989

The first is Threads Primer and is one of a series of technical programming books published by SunSoft Press and Prentice Hall for Sun Microsystems.

Providing an overview of the Solaris and POSIX multithreading architectures, this book explains threads at a level that is completely accessible to programmers and system architects with no previous knowledge of threads. Covers the business and technical benefits of threaded programs, along with discussions of third party software that is threaded, pointing out the benefits.

Programming with Threads - ISBN 0131723898

Programming with Threads is of a more advanced nature and deals with typical problems, applications and has plenty of examples.

This practical guide to developing multithreaded programs on UNIX, concentrates on when and how to apply threads, what problems to expect and how to deal with them. It covers advanced interfaces appropriate to performance-critical situations, explores the use of threads, and the construction of correct MT programs and libraries. The text also includes a variety of multithreading examples.

Deep C Secrets - ISBN 0131774298

If you're going to be programming threads in C, then Deep C Secrets is one book that I can recommend for a glimpse of Peter van der Linden's real-life experiences with C. It covers programming techniques, real-life examples of things that went wrong, lots of code snippets and examples and presents them in a conversational and easily readable style that'll make you wonder why they don't write books like this today.