Thread Safety
Execution control (order, execute concurrently) Memory visibility (results visibility to other threads)
💡 Thread will copy the main memory data to local and flush result back after completion.
Synchronized
Prevents any other thread from obtaining the monitor lock for the same object, thereby preventing other threads to access the object and executing concurrently. Creates a memory barrier which flushes results to CPU main memory and ensures the thread acquiring the lock first to operate before the thread acquiring the lock subsequently.
synchronous Vs asynchrounous
Synchronous functions are blocking while asynchronous functions are not. In...
Drop me an email if you are interested in me coding for you!