[Swift] What is asynchronous processing?

What is asynchronous processing?

Asynchronous processing is processing that does not stop another processing during ** execution. ** **

If you use asynchronous processing, while performing a certain processing Because you can execute another process without waiting for the end of that process, ** As a result, it leads to faster processing and realization of responsive GUI. ** **

Swift uses threads to implement asynchronous processing.

A thread is a virtual execution unit that uses a CPU. It is an image of a dedicated institution that performs processing!

Programs usually start in a single thread, the main thread. ** You can also create another thread from it to do the work there. ** **

Processing performed in another thread is executed in parallel with processing in the main thread.

Performing processing using multiple threads in this way is called ** multi-thread processing **.

But if multithreading is not implemented correctly, It can lead to serious problems such as:

**-Memory is exhausted due to excessive thread specifications -Inconsistency occurs when trying to update the same data from multiple threads -A deadlock occurs in which threads wait for each other **

To prevent these problems from occurring Programmers have to keep track of and manage threads.

So it's very convenient, but it's a difficult technique.

There are the following three methods for performing asynchronous processing. ** ・ Method using GCD -Method using Operation and OperationQueue classes ・ Method using Thread class **

Please see the separate article for these methods. ・ [Swift] Asynchronous processing "GCD" -[Swift] Asynchronous processing "Operation class" -[Swift] Asynchronous processing "Thread class"

This is the end of the explanation of asynchronous processing.

Since it is possible to prevent the user from having to wait when performing the thought processing, I think it's a fairly usable function.

Because you have to be careful about how to use it Let's understand and use it well!

Thank you for watching until the end.

Recommended Posts

[Swift] What is asynchronous processing?
[Swift] Asynchronous processing "GCD"
[Swift] What is dismiss?
[Swift] About asynchronous processing "Operation"
[Swift] Asynchronous processing using PromiseKit
[Swift] What is "inheriting a class"?
What is Cubby
What is Docker?
What is null? ]
What is Swift? Findings obtained in 3 weeks
What is java
What is Keycloak
What is maven?
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
What is Maven Assembly?
[Swift] Implement swipe processing
What is `docker-compose up`?
What is a constructor?
What is vue cli
What is an interface?
What is Ruby's self?
What is hard coding?
What is a stream
What is Ruby's attr_accessor?
What is Java Encapsulation?
What is permission denied?
What is instance control?
What is an initializer?
What is Spring Tools 4
What is an operator?
What is object orientation?
What is Guava's @VisibleForTesting?
What is MVC model?
What is an annotation?
What is Java technology?
What is Java API-java
What is @ (instance variable)?
What is Gradle's Artifact?
What is JPA Auditing?
[Java] What is flatMap?
What is a Servlet?
What is web development?
[Java] What is JavaBeans?