Working with Processes and Threads

All Windows CE–based applications consist of a process and one or more threads. A process is a single instance of a running application. A thread is the basic unit to which the Windows CE operating system (OS) allocates processor time. A thread can execute any part of the process code, including parts currently being executed by another thread.

Processes enable users to open and work in several applications at the same time. For example, a user can edit a file in a word processing application while another application is recalculating a spreadsheet. Threads enable an application to perform more than one task at a time even though applications cannot execute more than one thread at a time; however, Windows CE supports preemptive multitasking, which creates the effect of simultaneously executing multiple threads. When a process has more than one thread running, the OS rapidly switches from one thread to another so that the threads appear to run simultaneously.