Review of Operating System Content and Operating System Content
Thread: The thread is the execution unit in the process and the minimum unit for CPU allocation.
Components: thread stack and Kernel Object
The thread stack is the resource required to store threads.
The kernel object is a private block in the operating system. It is used to manage the current thread.
End mode: force-killing or natural exit
Exit multiple threads in the same process: Use a variable.
Exit of multiple threads in different processes: Cross-process operations can be performed using messages and events.
Thread status: Ready, executed, blocked, and killed
Inter-thread communication: Variable
Message
Thread Synchronization: To solve thread concurrency.
Synchronous method: Atomic access, using the keyword volitale
Critical section (key segment), normal mode or rotation lock, and asynchronous processing (synchronous and asynchronous)
Mutex (Kernel Object) features: the mutex is more secure. Cross-process, while the critical zone can only be in the same process
Event
Semaphores (with quantity control)