slide 10 of 19


Using bb_threads

  1. Start program as a single process
  2. Use bb_threads_stacksize(b) to set stack size
  3. Use bb_threads_mutexcreate(i) to initialize ith lock
  4. Use bb_threads_newthread(f, &arg) to create thread running f()
  5. Run parallel code, being careful to use bb_threads_lock(n) and bb_threads_unlock(n)
  6. Use bb_threads_cleanup(wait(NULL)) to clean-up after each thread