плане видимости изменений из другой корутины:
http://www.cs.umd.edu/users/pugh/java/memoryModel/jsr-133-faq.html#synchronization
But there is more to synchronization than mutual exclusion. Synchronization ensures that memory writes by a thread before or during a synchronized block are made visible in a predictable manner to other threads which synchronize on the same monitor. After we exit a synchronized block, we release the monitor, which has the effect of flushing the cache to main memory, so that writes made by this thread can be visible to other threads. Before we can enter a synchronized block, we acquire the monitor, which has the effect of invalidating the local processor cache so that variables will be reloaded from main memory. We will then be able to see all of the writes made visible by the previous release.
Нет, не является. Mutex не блокирует тред, а суспендится
Да. Любые корутиновые примитивы, которые подразумевают порядок, гарантируют synchronize-with (https://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html#jls-17.4.4), например: ch.receive() synchronizes-with ch.send _полученного элемента_, mutex.unlock() synchronizes-with со всеми ранее идущими (по SO, не по wall time) mutex.lock, coroutine.join() s-w coroutines.start()
Обсуждают сегодня