O'Reilly logo

Microsoft® Mobile Development Handbook by Peter Foot, Daniel Moth, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Threading and Application Shutdown

In Chapter 2, we state that an application terminates when its main form exits. The precise and more correct statement is that an application terminates when all foreground threads have exited. If an application does not create any threads, the only foreground thread is the main thread, and it terminates when the main form is closed; hence the original statement is true for such applications. This means you must understand what foreground threads are and how to ensure thatthey are terminated before the main form closes.

Background Threads

.NET threads can be foreground or background threads. By default, every thread explicitly created is a foreground thread and every thread from the ThreadPool or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required