Use the call()
method on SendPort
as a simple way to send a message and receive a reply. The call()
method returns a Future
for the reply. If you don't bother of the reply and simply want to send a message, use send()
.
Have a look at dart:isolate - Concurrency with Isolates for more informations.
For 3) it's explained in the above link :
In the standalone VM, the
main()
function runs in the first isolate (also known as the root isolate). When the root isolate terminates, it terminates the whole VM, regardless of whether other isolates are still running. For more information, see the section called “Keeping the root isolate alive”.