What is a parallel language?

From the Java language specification:

The Java β„’ programming language is a universal, parallel, class-based, object-oriented language.

What is a parallel language?

+3
source share
5 answers

This means that threads and synchronization are built into the language, and are not part of the library that you can include (e.g. PThreads for C).

+15
source

Designed for parallel computing .

+5
source

, , , , . .

- , , .

wikipedia

You can simply synchronize the method because Java is a parallel language. As in the document,

To synchronize a method, simply add the synchronized keyword to your ad:

public class SynchronizedCounter {
    private int c = 0;

    public synchronized void increment() {
        c++;
    }

    public synchronized void decrement() {
        c--;
    }

    public synchronized int value() {
        return c;
    }
}

across

+5
source

It looks like a brand of waffles ... almost none of me knows that any language will be "parallel" just because it has several primitives or syntactic sugar around threads and blocking.

+1
source

See if you want to know more about concurrency and java

0
source

Source: https://habr.com/ru/post/1715539/


All Articles