Home > Java > javaTutorial > What types of java memory barriers are there?

What types of java memory barriers are there?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-11 23:19:04
forward
1146 people have browsed it

Modern operating systems are multi-processors, each processor has its own cache, and these caches do not exchange information with memory in real time. Therefore, a CPU's cached data may be inconsistent with another CPU's cached data. In this way, in multi-threaded development, abnormal behavior may occur. The bottom layer of the operating system provides some memory barriers to solve these problems.

1. LoadLoad barrier

For such a language Load1, LoadLoad2, Load1 is guaranteed to be read before the data read in Load2 and subsequent read operations is accessed. of data is read.

2. StoreStore Barrier

Regarding such language Store1, StoreStore, Store2, before Store2 and subsequent writing are executed, it is guaranteed that the writing operation of Store1 can see other processor.

3. LoadStore Barrier

For such a language Load1, LoadStore, Store2, before Store2 and subsequent writing operations are executed, it is guaranteed that the data read by Load1 is read. .

4. StoreLoad barrier

For such a language Store1, StoreLoad; Load2, before Load2 and all subsequent reading operations are implemented, ensure that the input of Store1 can be seen All processors. The cost is among the four barriers (flush buffer, clear invalidation queue). In most processor implementations, this barrier is a universal barrier that also functions as the other three memory barriers.

What are the basic data types of java

The basic data types of Java are divided into:

1. Integer type, used to represent the data type of integer.

2. Floating point type, a data type used to represent decimals.

3. Character type. The keyword of character type is "char".

4. Boolean type is the basic data type that represents logical values.

The above is the detailed content of What types of java memory barriers are there?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Install JAVA
From 1970-01-01 08:00:00
0
0
0
Unable to install java
From 1970-01-01 08:00:00
0
0
0
Can java be used as the backend of the web?
From 1970-01-01 08:00:00
0
0
0
Is this in Java language?
From 1970-01-01 08:00:00
0
0
0
Help: JAVA encrypted data PHP decryption
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template