INFO5126_Threading Flashcards
_______ tend to be more expensive and slow because they involve ______-level operations
- Threads
- kernel
_______ run parallel on the system
Threads
_______ are lightweight and efficient with _______ overhead
- Coroutines
- minimal
_______ allows the scheduling of work to run using scheduling windows.
Work Manager
What is the main android thread referred to as?
UI Thread
What interface can be used to declare a thread class?
Runnable
What class should your class inherit from to implement a thread?
Thread
What are the 2 ways to create a thread in android?
- Class inherits from Thread
- Class implements Runnable interface
What function do you implement/override for a thread?
run()
What does currentThread() return?
Reference to the currently executing thread
What function is used to get a thread’s name?
getName()
What should you never do with a worker thread?
Update user interface elements
A coroutine is a _______ design pattern
Concurrency
A _______ keeps track of all your coroutines, and it can cancel all of the coroutines started in it.
CoroutineScope
A _______ models a cancellable workflow with multiple states and a life-cycle
Job