critical section
-
synchronizedStaticPL/JAVA 2020. 2. 27. 00:43
1. Overview Sometimes, you only want to prevent multiple thread access to part of the code inside a method instead of the entire method. The section of code you want to isolate this way is called a critical section and is also created using the synchronized keyword. 2. Critical section It this way, we can really achieve atomicity for any number of distinct operations without worrying about concu..
-
Resource Sharing, Critical Sections, and Atomic operationsModeling/Architecture 2020. 2. 27. 00:02
1. Overview Resource sharing is multi-thread architecture design. 2. Resource Sharing 2.1 What is a resource Variables (Integers, Strings, and etc.) Data Structures File or Connection handles Message or work queues Any Objects 2.2 Why share resources 2.2.1 Case 1 In this case, the benefit from sharing this data structure is that the document saver thread can save the user from losing his or her ..