'Difference between Isolate vs Thread vs Process?

As we know flutter app runs in an isolates. Somewhere I read that isolates are not system processes. So what really an isolate is and how it's different from process.



Solution 1:[1]

Good question. But there is no definite answer, because it depends on the language implementation.

Let me just quote the docs (emphasis mine):

Within an app, all Dart code runs in an isolate. Each Dart isolate has a single thread of execution and shares no mutable objects with other isolates. To communicate with each other, isolates use message passing. Although Dart’s isolate model is built with underlying primitives such as processes and threads that the operating system provides, the Dart VM’s use of these primitives is an implementation detail that this page doesn’t discuss.

Many Dart apps use only one isolate (the main isolate), but you can create additional isolates, enabling parallel code execution on multiple processor cores.

As you might know, threads and processes are managed by OS.

Isolates are managed by Dart runtime, and they use underlying OS threads and processes.

The Dart runtime controls the main isolate (where code normally runs) and any other isolates that the app creates.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 starriet