Since you added a Linux tag, I assume you are specifically referring to programs under Linux.
There is no "Critical section/Critical section" and "Event/Event" under Linux, so these two can be eliminated.
Atomic operation/Atomic operation cannot block threads, so it cannot be used if you need to let a thread wait for something. It is only suitable for ensuring data consistency.
Spin lock/spinlock is a lock that "blocks" a thread with a busy loop. It will occupy the CPU during the waiting process, so it is not suitable if you need to let a thread wait for something for a long time. It is only suitable for "blocking" In the event of extremely small probability, because spinlock will not transfer the CPU, if the conditions are almost always met, thread switching can be reduced. In addition, it cannot be used for process synchronization and is only applicable to threads in the same process.
Okay, all that's left is the mutex, and you know what it can do.
Since you added a Linux tag, I assume you are specifically referring to programs under Linux.
There is no "Critical section/Critical section" and "Event/Event" under Linux, so these two can be eliminated.
Atomic operation/Atomic operation cannot block threads, so it cannot be used if you need to let a thread wait for something. It is only suitable for ensuring data consistency.
Spin lock/spinlock is a lock that "blocks" a thread with a busy loop. It will occupy the CPU during the waiting process, so it is not suitable if you need to let a thread wait for something for a long time. It is only suitable for "blocking" In the event of extremely small probability, because spinlock will not transfer the CPU, if the conditions are almost always met, thread switching can be reduced. In addition, it cannot be used for process synchronization and is only applicable to threads in the same process. Okay, all that's left is the mutex, and you know what it can do.