Thread and mutex synchronization difference

1 refers to a mutex resources while allowing only a visitor to access it, is unique and exclusive. But visitors can not restrict access to exclusive order of resources, that access is not ordered.

2 synchronization refers to (in most cases), the visitor achieve orderly access to resources through other mechanisms mutually exclusive basis.

3 synchronization is already achieved mutually exclusive, so synchronization is a more complex mutually exclusive.

4 mutex is a special kind of synchronization.

synchronized ensure mutual exclusion,

wait and notify synchronization can be achieved on the basis of mutually exclusive

Guess you like

Origin www.cnblogs.com/moris5013/p/11824285.html