Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Synchronization

The simplest approach that can be used to synchronize the threads is called synchronization. It is implemented on the language level and is a standard construct in most programming languages.

The idea is as follows. Certain chunks of your programming code can be made guarded, which means they cannot be executed by the thread unless a certain condition is true. The condition in question is ownership of a so-called monitor. Therefore, a thread can own certain monitors. In a JVM setting, a monitor can be any object. So, on the JVM level, we can declare that a thread owns a monitor. Threads can take ownership and release the ownership of monitors at their own discretion. Another rule is that a monitor can only be held by one thread ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content