Presentation is loading. Please wait.

Presentation is loading. Please wait.

Windows CE Overview and Scheduling Presented by Dai Kawano.

Similar presentations


Presentation on theme: "Windows CE Overview and Scheduling Presented by Dai Kawano."— Presentation transcript:

1 Windows CE Overview and Scheduling Presented by Dai Kawano

2 Topic  Overview of Windows CE Windows CE in General Windows CE Architecture  Scheduling Processes and Threads Thread Scheduling Synchronization

3 Overview of Windows CE  Uses distinctively different kernel from desktop verison of Windows  32-bit operating system optimized for devices that have minimal storage industrial controllers, communications hubs cameras, telephones, hand-held computers  Supported on Intel x86 (and compatibles), MIPS, ARM, and Hitachi SuperH microprocessors  History Version 1.0 - Introduced in Nov/1996 Version 5.0 - Latest stable version releaed in May/2005 Version 6.0 - Scheduled to be released on Nov/2006

4 Windows CE Architecture Kernel create, terminate, and synchronize processes and threads schedule, suspend a thread assign priority to a thread support interrupt manage memory

5 Scheduling  The kernel maintains a priority list of each thread in the operating system  The scheduler Controls the order in which these threads are sequenced Allows threads to interact with each other in a predictable fashion Considers interrupts and reprioritizes the threads accordingly

6 Processes and Threads  All applications consists of 1 process 1 or more threads  Process Single instance of a running application Win CE supports 32 processes running simultaneously  Thread Independent portion of a process and is the basic unit that the operating system allocates processor time to Execute any part of the process code 256 priority levels

7 Thread Scheduling  Windows CE uses a priority-based time- slice algorithm to schedule the execution of threads Higher priority runs first Same priority runs in a round-robin fashion Lower priority run only when all threads with a higher priority are not ready to run

8 Thread Scheduling (continued)  Threads run for a specific amount of time called a quantum Default is 100ms but OEM’s can specify a different value Per quantum a thread is suspended and another thread is scheduled to run  Thread priorities are typically fixed and do not change One exception – Priority Inheritance  Thread can be suspended anytime

9 Synchronization  Synchronization Objects Critical Section Mutex Event Notification Semaphore  Interlocked Functions  Point-to-Point Message Queue

10 Synchronization – Critical Sections  Enter critical section EnterCriticalSection TryEnterCriticalSection  Leave critical section LeaveCriticalSection

11 Synchronization – Mutex  Mutex - Synchronization object whose state is set to signaled when it is not owned by a thread and nonsignaled when it is  CreateMutex - Create a mutex CreateMutex  Wait functions - Waiting to own mutex WaitForSingleObject WaitForMultipleObjects MsgWaitForMultipleObjects  ReleaseMutex – Release the mutex ReleaseMutex

12 Synchronization – Event Notifications  Windows CE uses event objects to: Notify a thread when to perform its task Indicate that an event has occurred  CreateEvent – Creates an event CreateEvent  PulseEvent - Signals and reset the event  SetEvent - Signals the event  ResetEvent - Resets the event ResetEvent

13 Synchronization – Semaphores  Semaphore - Interprocess synchronization object that limits the number of threads using a resource.  CreateSemaphore - Creates a semaphore CreateSemaphore  Wait functions to request for a semaphore  ReleaseSemaphore - Releases a semaphore ReleaseSemaphore

14 Synchronization – Interlock Functions  Synchronize access to a variable that is shared by multiple threads. ToCall Increment a shared variable and check the resulting value InterlockedIncrement Decrement a shared variable and check the resulting value InterlockedDecrement Exchange the values of specified variablesInterlockedExchange Exchange the values of specified variables if one variable is equal to a specified value InterlockedTestExchange Compare the values of specified values and exchange the values based on the outcome InterlockedCompareExchange Perform an atomic addition of an increment value to an addend value InterlockedExchangeAdd Perform an atomic comparison of specified values and exchange the values based on the outcome of the comparison InterlockedCompareExchangePointer Atomically exchange a pair of valuesInterlockedExchangePointer

15 Synchronization – Message Queue  The only support Windows CE provided as far as message queue is the point-to-point message queue. FunctionDescription CreateMsgQueue Creates or opens a user-defined message queue. OpenMsgQueue Opens a handle to an existing message queue. CloseMsgQueue Closes an open message queue. ReadMsgQueue Reads a single message from a message queue. WriteMsgQueue Writes a single message to a message queue. GetMsgQueueInfo Returns information about a message queue.

16 References  Microsoft Website - http://msdn.microsoft.com/library/default.asp?url =/library/en- us/wcemain4/html/cmconScheduling.asp http://msdn.microsoft.com/library/default.asp?url =/library/en- us/wcemain4/html/cmconScheduling.asp  Wikipedia - http://en.wikipedia.org/wiki/Windows_CE http://en.wikipedia.org/wiki/Windows_CE  HPC factor - http://www.hpcfactor.com/support/windowsce/ http://www.hpcfactor.com/support/windowsce/


Download ppt "Windows CE Overview and Scheduling Presented by Dai Kawano."

Similar presentations


Ads by Google