Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
All applications that are based on Windows Mobile consist of a process and one or more threads .
- A process is a single instance of a running application.
- A thread is an independent portion of a process.
Processes
Processes enable users to open and work in several applications at the same time. For example, a user can edit a file in a text editor while another application is recalculating a spreadsheet.
As a preemptive multitasking OS, Windows Mobile supports multiple processes running simultaneously on the system.
There is no limit to the number of processes that can run on a Windows phone. The only limit is the amount of available system resources.
Threads
A thread is the basic unit to which the OS allocates processor time. Threads have the following characteristics:
- They enable an application to perform more than one task at a
time, even though applications cannot run more than one thread at a
time.
- They can run any part of the process code, including parts that
are being run by another thread.
- Although one thread is designated as the primary thread for the
process, a process can also create an unspecified number of
additional threads.
- Available system resources limit the number of threads.
- Windows Mobile provides 256 priority levels that you can set
for a thread. To assign priority levels, Windows Mobile uses the
following functions:
-
CeSetThreadPrioritysets the priority for a specified thread.
-
CeGetThreadPriorityreturns 0 (zero) as the highest priority and
255 as the lowest priority.
-
CeSetThreadPrioritysets the priority for a specified thread.
- If an OEM enforces a trusted environment, Windows Mobile can
protect the top 248 priority levels from applications.
Because Windows Mobile supports preemptive multitasking, it creates the effect of a process simultaneously running 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.