Wednesday, July 30, 2008

Critical Section vs. Mutex

Both critical sections and mutex objects can be used to synchronize code execution in a Windows CE system.  Judicious use of these techniques is necessary to prevent sharing conflicts over system resources through synchronized access.  But why would a programmer choose one method over the other?

 

A critical section is defined as a segment of code that can be run by at most one thread at any instance of time. All code that accesses a shared resource should be placed within a critical section in order to synchronize access to the resource. In effect, mutually exclusive access to the resource is guaranteed if all accesses are guarded by the same critical section.

 

A mutex object is ‘signaled’ when it is not owned by a thread. A thread takes ownership of the synchronizing mutex object prior to accessing a shared resource.  If the resource is already in use by another thread, then access will be blocked. Exclusive access can be guaranteed provided all accesses to the resource are guarded by the same mutex object.

 

Now to highlight the differences: In general, mutex objects are more CPU intensive and slower to use than critical sections due to a larger amount of bookkeeping, and the deep execution path into the kernel taken to acquire a mutex. The equivalent functions for accessing a critical section remain in thread context, and consist of merely checking and incrementing/decrementing lock-count related data.  This makes critical sections light weight, fast, and easy to use for thread synchronization within a process. The primary benefit of using a mutex object is that a mutex can be named and shared across process boundaries.

 

Best practices to optimize for performance include:

  • Minimizing the need to synchronize across process boundaries during software design
  • Minimizing the use of mutex objects whenever possible
  • Using critical sections for synchronization whenever possible

 



More information on critical section and mutex APIs can be found on MSDN:

Friday, July 25, 2008

Microsoft Press: Windows Embedded CE 6.0 Fundamentals

Microsoft Press: Windows Embedded CE 6.0 Fundamentals by Stanislav Pavlov and Pavel Belevsky.

This book is intended for everyone who develops or plans the development of embedded devices based on Windows Embedded CE. If you are just learning about the Windows Embedded CE operating system, this book can serve as a starting point for further learning. If you are already familiar with Windows Embedded CE, this book provides advice and recommendations for application development.

Here's the chapter listing for the book:

  • Chapter 1: Introduction
  • Chapter 2: Operating System and Application
  • Chapter 3: Operating System Architecture
  • Chapter 4: Subsystem for Building an Operating System
  • Chapter 5: Board Support Package (BSP)
  • Chapter 6: Driver Architecture
  • Chapter 7: Loading the Operating System
  • Chapter 8: Building Devices
  • Chapter 9: Application Development

Thursday, July 24, 2008

Embedded Linux: With friends like these, who needs enemies?

Embedded Linux: With friends like these, who needs enemies?

If embedded Linux champions are saying that embedded Linux is terrible, why would anyone want to risk their products or their company on it?

Embedded Linux is the most hyped embedded operating system ever. It is promoted as inexpensive, high quality, high productivity, reliable, widely available, and well supported. It is none of these things, as two of its greatest proponents have recently pointed out. Wind River Systems and MontaVista Software, companies that each describe themselves as "the leader" in embedded Linux, have both initiated marketing campaigns touting the horrors of using embedded Linux.


Source : Click Here

Sunday, July 20, 2008

Rear-view mirror sports Windows CE-based GPS












U.S. motorists can now put a Windows CE-based navigation, safety, and entertainment system in their car's rear-view mirror. Azentek has announced the SmartMirror, featuring a 4-inch touchscreen monitor, rear-view camera, Bluetooth, built-in speakers, 3D maps, and an SD expansion slot.

 However, Michigan-based Azentek has adapted it with U.S.-specific maps from The SmartMirror is apparently based on hardware from Chinese automotive electronics maker Shenzhen Dsus, which first announced the device as the DS-400GB (right) in March.Navigon. Navigon's maps display 3D images that are said to include buildings, hills, visualizations of complex freeway interchanges, and even actual roadsign text, as shown below.


Navigon-supplied maps display freeway interchanges and even roadsign text

The SmartMirror is designed to replace a car's standard rear-view mirror. It features its own mirror plus, at the right, a 4-inch touchscreen with 480 x 272 pixel resolution. By default, this display shows GPS information, but the SmartMirror also has two external video inputs, which can display a vehicle's surroundings via optional rear- or side-mounted cameras.

Like a multitude of traditionally housed automotive navigation devices, the SmartMirror packs the SiRF starIII chipset. The device is based on Windows CE 4.2, has a Samsung S3C2440A processor clocked at 400MHz, and 64MB of RAM. An integral SD expansion slot accepts a 2GB card that is bundled with the unit.

According to Azentek, the SmartMirror also includes Bluetooth, through which it is capable of pairing with a mobile phone. The device offers hands-free calling, speakerphone functionality, and displays caller ID information. While Azentek does not tout multimedia playback, Shenzen Dsus said its DS-400GB is capable of playing MP3 files through its dual built-in speakers, and that functionality is likely to be available on the SmartMirror as well.

Features and specifications cited by Azentek for the SmartMirror include:
  • Processor -- Samsung S3C2440A clocked at 400MHz
  • Memory -- 64MB of RAM and 2GB of flash (via SD slot)
  • Operating system -- Windows CE 4.2
  • Display -- 4-inch touchscreen with 480 x 272 resolution
  • I/O:
    • Video inputs for side and rear-view cameras
    • Connector for external antenna
    • Speakers (2 x 1W amplification)
  • Expansion -- SD card
  • Dimensions -- not listed
  • Operating temperature -- not listed
  • Storage temperature -- -65 to 150 deg. C
The SmartMirror is available now for a list price of approximately $800. More information may be available from the company's website, here.
  

Friday, July 4, 2008

Windows XPe cocktail fountain

Digital Beverage has created a product called MyFountain. Running Windows XP Embedded this “digital bartender” is a fully automated drink fountain that mixes drinks, pours them and cleans the nozzle afterwards with hot water—no bartender required. MyFountain also comes with a mini-computer and touchscreen so you can create your own drinks with the online recipe generator. Digital Beverage also has created a higher end model run on Windows XP Embedded called the Virtual Bartender. Isn't that cool?






.