Multithreaded Programming with ThreadMentor: A Tutorial

Dr. C.-K. Shene

Professor
Department of Computer Science
Michigan Technological University

© 2001-2014 C.-K. Shene



You are visitor since August 20, 2001
Created: August 20, 2001
Last update: March 17, 2014

Select the topics you wish to review:

Local Availability
System Overview
Compile and Run Your Programs
Thread Fundamentals
Why Threads?
Basic Thread Management
Thread Management: ThreadMentor's Way
Overview
Before You Start
Creating and Terminating Threads
Joining Threads
Visualizing Thread Execution
Examples
Merging Two Arrays
Visualization
Threaded Quicksort
Visualization
Problems
Matrix Multiplication
Maximum Finding
The First Positive Elements of an Array
Mutual Exclusion Locks: mutex
Basic Concept
The Mutex Lock Primitive
Visualizing Mutex Locks
Examples
The Dining Philosophers Problem
Visualization
The Dining Philosophers Problem: The Lefty-Right Version
Visualization
Semaphores
Basic Concept
The Semaphore Primitive
Three Commonly Used Techniques
Visualizing Semaphores
Examples
The Dining Philosophers Problem: Four Chairs
Visualization
The Smokers Problem
Visualization
The Producer/Consumer (or Bounded-Buffer) Problem
Visualization
The Roller Coaster Problem
Visualization
Problems
Baboons Crossing a Canyon
Hungry Eagles
Race Conditions: A Problem Difficult to Detect
Race Conditions: Revisited
A Simple Problem
First Attempt
Second Attempt
Third Attempt
Fourth Attempt
A Good Attempt
Simplified Solutions
Why Are Race Conditions So Difficult to Detect?
Monitors
Basic Concept
The Monitor Primitive
Visualizing Monitors: Part I
Examples
Managing a Shared Counter
Visualization
Condition Variables
Monitor Types
Semaphore vs. Monitor
Visualizing Monitors: Part II
Examples
The Dining Philosophers Problem: Revisited
Visualization
The Dining Philosophers Problem: version 5
Visualization
Alarm Clock
Visualization
The Producer/Consumer (or Bounded-Buffer) Problem
Visualization
Bridge Crossing
Visualization
Channels
Basic Concept
The Channel Primitive
Visualizing Asynchronous Channels
Examples: Asynchronous Channels
Linear Array Sorting
Visualization
A Sorting Network of Merge Threads


Acknowledgments


Please send comments and suggestions to shene@mtu.edu