ABSTRACT

In this chapter, the author utilizes 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. 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. The first step in mastering the use of ThreadX is to understand the nature and behavior of threads. ThreadX uses a preemptive scheduling algorithm, which means that threads with higher priorities generally have the ability to preempt the execution of threads with lower priorities. Very generally, a critical section is one that imposes certain constraints on thread execution. No thread can pre-empt a mutex owned by another thread regardless of either thread’s priority. This is an important feature that provides inter-thread mutual exclusion.