Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-gq7q9 Total loading time: 0 Render date: 2024-07-22T17:26:34.681Z Has data issue: false hasContentIssue false

5 - Execution model

Published online by Cambridge University Press:  05 August 2012

Philip Levis
Affiliation:
Stanford University, California
David Gay
Affiliation:
Intel Research, Berkeley
Get access

Summary

This chapter presents TinyOS 's execution model, which is based on split-phase operations, run-to-completion tasks and interrupt handlers. Chapter 3 introduced components and modules, Chapter 4 introduced how to connect components together through wiring. This chapter goes into how these components execute, and how you can manage the concurrency between them in order to keep a system responsive. This chapter focuses on tasks, the basic concurrency mechanism in nesC and TinyOS. We defer discussion of concurrency issues relating to interrupt handlers and resource sharing to Chapter 11, as these typically only arise in very high-performance applications and low-level drivers.

Overview

As we saw in Section 3.4, all TinyOS I/O (and long-running) operations are split-phase, avoiding the need for threads and allowing TinyOS programs to execute on a single stack. In place of threads, all code in a TinyOS program is executed either by a task or an interrupt handler. A task is in effect a lightweight deferred procedure call: a task can be posted at anytime and posted tasks are executed later, one-at-a-time, by the TinyOS scheduler. Interrupts, in contrast can occur at any time, interrupting tasks or other interrupt handlers (except when interrupts are disabled).

While a task or interrupt handler is declared within a particular module, its execution may cross component boundaries when it calls a command or signals an event (Figure 5.1).As a result, it isn't always immediately clear whether a piece of code is only executed by tasks or if it can also be executed from an interrupt handler.

Type
Chapter
Information
TinyOS Programming , pp. 71 - 78
Publisher: Cambridge University Press
Print publication year: 2009

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Execution model
  • Philip Levis, Stanford University, California, David Gay
  • Book: TinyOS Programming
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626609.007
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Execution model
  • Philip Levis, Stanford University, California, David Gay
  • Book: TinyOS Programming
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626609.007
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Execution model
  • Philip Levis, Stanford University, California, David Gay
  • Book: TinyOS Programming
  • Online publication: 05 August 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626609.007
Available formats
×