Andy Pack
5f04cacd81
Affected files: .obsidian/workspace.json Projects/Dev Options.md Projects/Mixonomer.md Projects/NoteCrawler.md Projects/Selector.md Projects/To Do App.md STEM/CS/ABI.md STEM/CS/Calling Conventions.md STEM/CS/Code Types.md STEM/CS/Compilers.md STEM/CS/ISA.md STEM/CS/Language Binding.md STEM/CS/Languages/Assembly.md STEM/CS/Languages/C++.md STEM/CS/Languages/Javascript.md STEM/CS/Languages/Python.md STEM/CS/Languages/Rust.md STEM/CS/Languages/dotNet.md STEM/IOT/OS/Composition.md
1.5 KiB
1.5 KiB
tags | |
---|---|
|
Threading
Smallest sequence of programmed instructions that can be managed independently by a scheduler From <https://en.wikipedia.org/wiki/Thread_(computing)>
- Instructions run independently by scheduler
- Single address space
- One thread blocked for I/O
- Tasks run in other threads
- Need locks and mutexes
- Coordination between threads
- Complicated
- Deadlocks
Protothreads
- Lightweight
- Stack-less
- Interruptible tasks for event-based
- Conditional blocking statement
- Blocks until given statement is true
- Use timer to manage
- Invoked whenever process receives message from another process or timer
Events
Action or occurrence recognized by software, often originating asynchronously from the external environment, that may be handled by the software From <https://en.wikipedia.org/wiki/Event_(computing)>
- Event loop
- Waits for events
- Inputs
- Waits for events
- On event
- Collects info
- Dispatches to call-back
- Collects info
- Register handlers with OS scheduler
- Kernel usually runs loop to poll for events
- Blocking operation
- Register call-back
- Return control to scheduler
- Register call-back
Radio Sleep
- Energy efficiency
- Congestion
Event-based
Thread-based
- Less complex
- Faster
- Pointer-based