Week 7b - Processes and Threads

Models and simple examples

Content:

This lecture focuses on threading code examples. You are encouraged to ask questions during the discussion, for both the threading material and your project work. Please spend time compiling and running these examples after the lecture.
  1. The Syllabus describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  2. Project Statements:

  3. Midterm Exam

    You may wish to look ahead at Topics and materials to study for the Midterm Examination in next week's lecture page Wk #8a.
    If you have questions about the midterm, please ask.
  4. Code Demos:

    Starting Threads
    Discusses several ways to create .Net threads.

    Basic Thread Demos, WPF Thread Demos
    Fairly simple examples of thread applications.

    Blocking Queue using Monitor
    Blocking Queues are very useful for sending messages between threads - helps to keep threading models simple.

    Queued Messages with BlockingQueue
    This is a queueing demo.

    Abstract Task Model
    .Net Tasks simplify communication between parent and child threads.

    Basic Tasks, async await pattern
    More details about tasks.

    WPF Dispatcher Invoke Demo
    Child threads are not allowed to directly communicate with a parent window.
    Here's how to manage child thread to UI-thread communication.

    .Net FormInvoke Demo
    Same demo, but for legacy WinForms.
  5. Basic Windows Concepts

  6. Threads