This page is intended to provide an introductory tutorial to the writing of thread programs - specifically, POSIX thread programs - on the IBM J-30 multiprocessor. In time, it'll be updated to reflect changing needs, additions and trends. If any discrepancy in the information provided here is noted by the reader, or if the reader wishes to make any suggestion regarding this page, he or she is most welcome to do so, by writing an e-mail to the author mentioned below.


An overview of threads


Threads, shorn of all intricacies, are merely distinct flows of control that run concurrently, and which share a common address space. If we were to take snapshots of concurrently running threads at different points during their execution lifetimes, each would be characterised by a unique value for the program counter, a collection of values for the register set, as well as a distinct stack. The shared memory paradigm is beneficial in the sense that it allows thread programs to be easily ported from single processor machines to multiprocessor ones, with minimal code change. On a single processor machine, the threaded application would perform roughly the same as a conventional sequential program that does the same task, with an additional overhead that is a consequence of thread switching.

Numerous runtime libraries that implement a multi-threadeded programming environment are available (eg. Solaris Threads, DCE threads, etc). In this tutorial, we concentrate on one specific implementation, namely POSIX threads, or pthreads in short.

POSIX threads

"Real" POSIX threads conform to the IEEE approved 1003.1c-1995 POSIX standard, that was passed in 1995. Much of the POSIX threads tutorials that you get to see on the Internet, are written for this standard. However, the IBM J-30 currently supports a specification of pthreads, that is older than the standard. In particular, it corresponds to 1003.4a Draft 7, a specification which became the standard after it reached the level of Draft 10.

A simple program, hello.c obtained from Sun's thread page, and that was written for the standard, was modified to be executed on the IBM J-30. The source and the makefile are available below:

  • hello.c
  • Makefile
  • Below are two pthreads programs that perform the same task, namely, solving a system of linear equations using Gaussian Elimination. The related makefile has also been provided below. To bring the executables upto date, type make at the blueser command-line. You then have to invoke gaussPT-IBM with the relevant parameters on the command-line. To know what the parameters should be, just type gaussPT-IBM alone.

  • gaussPT-IBM.c - written for the 1003.4a Draft 7 specification.
  • gaussPT.c - written for the IEEE 1003.1c POSIX standard.
  • Makefile - a makefile to generate gaussPT-IBM on the IBM J-30.
  • Some sample runtimes were collected for the Gaussian Elimination program, across the 8 node SGI Origin 2000 and the IBM J-30 . However, these values may not be reproducible, as they are very much influenced by system loads existent at the time of execution; this may affect, for example, the thread distribution by the kernel across the processors.

    Other thread resources

  • Sun's threads site.
  • General information on pthreads.
  • Getting started with POSIX threads.
  • FSU Pthreads (POSIX threads).
  • AIX threads.
  • IRIX threads.
  • A compendium of frequently asked questions.

  • Last updated on 07/31/97 by G. Pramod Joisha