Windows Embedded CE includes several process management functions as part of the core Win32 API. Three important functions are listed in Table 3-8 that are useful for creating and ending processes.

Table 3-8 Process management functions

Function Description
CreateProcess Starts a new process.
ExitProcess Ends a process with cleanup and unloading DLLs.
TerminateProcess Terminates a process without cleanup or unloading DLLs.
MORE INFO Process management API

For more information about process management functions and complete API documentation, see the Core OS Reference for Windows Mobile® 6 and Windows Embedded CE 6.0, available on the Microsoft MSDN website at http://msdn2.microsoft.com/en-us/library/aa910709.aspx.

Thread Management API

Each process has at least one thread called the primary thread. This is the main thread of the process, which means that exiting or terminating this thread also ends the process. The primary thread can also create additional threads, such as worker threads, to perform parallel calculations or accomplish other processing tasks. These additional threads can create more threads if necessary by using the core Win32 API. Table 3-9 lists the most important functions to use in applications that work with threads on Windows Embedded CE.

Table 3-9 Thread management functions

Function Description
CreateThread Creates a new thread.
ExitThread Ends a thread.
TerminateThread Stops a specified thread without running cleanup or other code. Use this function only in extreme cases because terminating a thread can leave memory objects behind and cause memory leaks.
GetExitCodeThread Returns the thread exit code.
CeSetThreadPriority Sets the thread priority.
CeGetThreadPriority Gets the current thread priority.
SuspendThread Suspends a thread.
ResumeThread Resumes a suspended thread.
Sleep Suspends a thread for a specified amount of time.
SleepTillTick Suspends a thread until the next system tick.
MORE INFO Thread management API

For more information about thread management functions and complete API documentation, see the Core OS Reference for Windows Mobile 6 and Windows Embedded CE 6.0, available on the Microsoft MSDN website at http://msdn2.microsoft.com/en-us/library/aa910709.aspx.

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату