Reputation: 7973
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.
Upvotes: 1
Views: 628
Reputation: 3948
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.
Upvotes: 1