Threads in C
-
Upload
meredith-moss -
Category
Documents
-
view
27 -
download
2
description
Transcript of Threads in C
![Page 1: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/1.jpg)
Threads in C
Using threads to structure programs in C.
![Page 2: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/2.jpg)
Welcome to the family…
C6808Code Development System
OptimizingC compiler and development tools for the entire Freescale ’08 family.
![Page 3: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/3.jpg)
C6808
• Optimizing, standards-basedC cross-compiler.
• Very tight code generation;“We win benchmarks”.
• Fixed-point transcendental library.
• Support for event-driven applications in C…
![Page 4: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/4.jpg)
Threads
• Execution paths with common state.• Event-driven.• Brings interrupt style
into general programming.• Fully compatible
with standard C.
![Page 5: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/5.jpg)
Hardware Event Expression DispatchACMPSC.ACF == 1&& state == READY
ISR() { /* Interrupt code */}
IRQ
THREAD() { /* Thread code */}
__DISPATCH();
Threads
• “Pseudo-hardware” allows event-driven programs.
![Page 6: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/6.jpg)
Hardware Event Expression DispatchACMPSC.ACF == 1&& state == READY
ISR() { /* Interrupt code */}
IRQ
THREAD() { /* Thread code */}
__DISPATCH();
Threads
• Dispatch on arbitrary expressions.
![Page 7: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/7.jpg)
Hardware Event Expression DispatchACMPSC.ACF == 1&& state == READY
ISR() { /* Interrupt code */}
IRQ
THREAD() { /* Thread code */}
__DISPATCH();
Threads
• Separate and organize dispatch and event code.
![Page 8: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/8.jpg)
Run-to-Completion
• Asynchronous programming costs resources.
• Less complex than an RTOS.
![Page 9: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/9.jpg)
AboutByte Craft Limited
• 30 years in the embedded marketplace.
• Our main products: C cross-compilers.
• Experts in code generation.
![Page 10: Threads in C](https://reader036.fdocuments.net/reader036/viewer/2022082817/56812bcb550346895d9022b8/html5/thumbnails/10.jpg)
Thank You.
http://www.bytecraft.com/Threads_in_C