# Real-Time, OS, Embedded Shits {%hackmd BJrTq20hE %} ###### tags: `For Work` ###### tags: `Current_2021` 1. mutex vs spinlock vs semaphore 2. kernel space vs user space Kernel space 是 Linux 核心的執行空間,User space 是使用者程式的執行空間。為了安全,它們是隔離的,即使使用者的程式崩潰了,核心也不受影響。 ![](https://i.imgur.com/XdtoOYG.png) ```c=1 str = "my string" // 使用者空間 x = x + 2 // 使用者空間 file.write(str) // 切換到核心空間 y = x + 4 // 切換回使用者空間 ``` 3. sleep vs busy waiting 4. context switch 5. process vs thread 6. linux vs android 7. risc vs cisc [PCP, SRP (Priority Ceiling Protocol and Stack-based Resource Policy)](https://blog.zhougy.top/2019/02/04/Resource_Access_Protocol_-_PIP,_PCP,_SRP/)