Summary

This code-heavy chapter has guided you through understanding why you may use threads and how they work at the operating system level to writing code for marshaling data from worker threads to the main thread and the various synchronization objects available to the .NET Compact Framework developer. The key points to take away are the following:

  • Never block the user interface.

  • More threads does not equal more performance.

  • Avoiding race conditions and deadlocks is possible only through careful design and total knowledge of the system under implementation. Simply testing for these conditions does not necessarily reveal threading issues because such issues are hard to reproduce.

  • The System.Threading namespace is fairly rich in version 2.0, and ...

Get Microsoft® Mobile Development Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.