Java high concurrent multi-threaded development



Business needs:
JAVA high-concurrency programming uses a multi-threaded server-side to process scenarios where multiple client-side clients access the server at the same time, etc.
Parallel computing generally requires processing big data only in image processing and server-side programming, requiring multi-threaded high-concurrency processing.
Parallel programs can indeed run faster on multi-core CPU computers.

Synchronous: Waiting for the program to return a result.
Asynchronous: Work tasks that are called asynchronously are processed in other programs and do not affect the main business process.

A single CPU can only handle one thread, and multiple CPUs are executing in parallel.
Parallelism and concurrency are generally understood to be the same.

The critical section is an area that needs to be controlled, because it is hoped that only one thread will enter the processing at a time, all that need to be controlled, and multi-threaded access needs to pay attention to what is not destroyed here. under protection.

Blocking and non-blocking:
The way of blocking: the general thread is suspended, and the performance is not good. If a thread occupies a resource and does not release it, other threads wait until the wait.

Non-blocking way: high performance.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326939356&siteId=291194637