Justin
Outline Introduction The Challenge of Preemption TOSThreads Architecture Implementation Evaluation
Introduction Operating System for WSNs Support multiple concurrent execution ○ Network protocol, storage and data filter…etc Event-driven execution ○ TinyOS Disadvantage Develop higher-level services and application ○ Compression
The Challenge of Preemption Challenge: Ability to call kernel code (code interact with hardware) Common techniques Cooperative threading – using yield Kernel locking – using mutex Message passing
TOSThreads Architecture TinyOS – two classes of execution Synchronous (tasks) Asynchronous (interrupts) TOSThreads – third class User-level application threads Goals Minimun TinyOS kernel modification
TOSThreads Architecture Original TinyOS
Implementation Platform independent Thread scheduler Thread and system call structure Dynamic linking and loading Platform dependent Context switch (assembly language) Post-amble for interrupt handler
Flexible User/Kernel Boundary Blocking system call API Dynamic Linker and Loader System Call Task Application-level thread 1,2,3… SendRecv SenseFile Kernel-level thread TinyOS Original code
Kernel-level thread TinyOS Original code App-level thread 1 App-level thread 2 App-level thread 3 Thread Scheduler TinyOS Modification Boot sequence Hardware Initialize Task Scheduler
Evaluation - Microbenchmark Overhead can be tolerated
Evaluation - Energy analysis SSF application (Sense, Store and Forward) Sense and write to flash per 5 mins Send via radio per 12hours
Evaluation - Tenet A linear dataflow programs consisting of a sequence of tasklets. Repeat(1000ms) > Sample(ADC1,T) > LEQ(A,T,50) > DeleteDataIf(A) > Send()
Evaluation - Tenet Tenet – C Implement in TOSThread and TinyLD
Evaluation - Tenet Tenet – C Implement in TOSThread and TinyLD Repeat(100ms) > ReadBlock(A,1024) > Avg(B,A) > MeanDev(C,A) > Send() Repeat(50ms) > TimeStamp(A) > Sample(ADC5,V) > Send() TaskLong TaskSample
Evaluation - Tenet
Conclusion TOSThread Thread-safe Non-invasive Overhead is less Dynamic linking and loading is less – 0.92%