Real-Time Embedded Multithreading: Using ThreadX and ARM

We will use the Win32 version of ThreadX because it permits developers to develop prototypes of their applications in the easy-to-use and prevalent Windows programming environment. We achieve complete ThreadX simulation by using Win32 calls. The ThreadX-specific application code developed in this environment will execute in an identical fashion on the eventual target hardware. Thus, ThreadX simulation allows real software development to start well before the actual target hardware is available. We will use Microsoft Visual C/C++ version 6.0 to compile all the embedded systems in this book.
There is a demonstration version of ThreadX on the CD included with this book. View the Readme file for information about installing and using this demonstration system.
The first step in mastering the use of ThreadX is to understand the nature and behavior of threads. We will achieve this purpose by performing the following operations in this sample system: create several threads, assign several activities to each thread, and compel the threads to cooperate in the execution of their activities. A mutex will be used to coordinate the thread activities, and a memory byte pool will be used to create stacks for the threads. (Mutexes and stacks are described in more detail later.)
The first two components that we create are two threads named Speedy_Thread and Slow_Thread. Speedy_Thread will have a higher priority than Slow_Thread and will generally finish its activities more quickly. ThreadX...