{"id":352951,"date":"2024-05-20T22:18:26","date_gmt":"2024-05-20T22:18:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352951"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T22:18:26","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352951","title":{"rendered":"<span>4.0 \u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c. Isolates, \u043f\u043e\u0442\u043e\u043a\u0438, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0443 \u0432\u043e\u0442 \u043e\u043d\u0430 \u0441\u0430\u043c\u0430\u044f <em>\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0442\u0435\u043c\u0430<\/em> \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e)<\/p>\n<h2>\u041f\u0440\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u043e\u0442\u043e\u043a\u0438<\/h2>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0430\u043d\u0446\u0430 \u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u043e\u0433\u0430\u043c\u0438 \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u0439, \u043d\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0438 \u0442\u043e\u0447\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u043c\u0438 \u0442\u0430\u043d\u0446\u043e\u0440\u0430\u043c\u0438 \u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043c\u043e\u0437\u0433\u0430. \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b, \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0431\u044b\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u044a\u044f\u0434\u0435\u0440\u043d\u044b\u0435, \u0432\u043e\u0441\u044c\u043c\u0438\u044f\u0434\u0435\u0440\u043d\u044b\u0435 \u0438 \u0442.\u0434.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 <strong>\u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044f\u0434\u0435\u0440 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435,<\/strong> \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043d\u0446\u043e\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0441\u044c\u043c\u0438 \u044f\u0434\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e<\/strong> \u0442\u043e\u043b\u044c\u043a\u043e 8 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0430\u043d\u0446\u043e\u0440\u044b-\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u043c\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043c\u044b, \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043b\u044e\u0434\u0438, \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0434\u043d\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438, \u0434\u0435\u043b\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0440\u0443\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u043d\u043e\u0433\u0430\u043c\u0438.<\/p>\n<blockquote>\n<p><strong>\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/strong>\u00a0\u2014 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438\u00a0\u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b(\u043d\u0430\u0431\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432) \u043d\u0430\u00a0\u041e\u0421. \u0421\u043e\u0437\u0434\u0430\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c: \u043f\u0430\u043c\u044f\u0442\u044c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u0432\u043e\u0434\u0430\\\u0432\u044b\u0432\u043e\u0434\u0430, \u043a\u0430\u043c\u0435\u0440\u0430 \u0438 \u0442\u0434.<\/p>\n<p><strong>\u041f\u043e\u0442\u043e\u043a\u0438<\/strong> \u2014 <strong>\u044d\u0442\u043e<\/strong> \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (unit of execution), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435. \u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/blockquote>\n<p><em>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(\u0438\u043b\u0438 dart-\u043a\u043e\u0434) \u043e\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 <\/em><strong><em>\u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435<\/em><\/strong><em> \u0438 \u0432 <\/em><strong><em>\u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435.<\/em><\/strong><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ee\/99e\/183\/1ee99e183ea5d617ad5fc6b406ff2c76.png\" alt=\"\" title=\"\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ee\/99e\/183\/1ee99e183ea5d617ad5fc6b406ff2c76.png\"\/><\/figure>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<h2>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0442\u044b \u0437\u043d\u0430\u0435\u0448\u044c async, await, Future \u0438 \u0434\u0443\u043c\u0430\u0435\u0448\u044c \u0447\u0442\u043e \u043f\u043e\u0431\u0435\u0434\u0438\u043b \u0432\u0440\u0435\u043c\u044f. <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f  \u0438 \u0442\u044b \u0443\u0432\u0438\u0434\u0438\u0448\u044c, \u043a\u0430\u043a \u0442\u0432\u043e\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442, \u0430 \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d. <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"dart\">const String filename = 'with_keys.json';  void main() async {   \/\/ Read some data.   final fileData = await _readFileAsync();    \/\/ \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \/\/ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f      final jsonData = jsonDecode(fileData);    \/\/ Use that data.   print('Number of JSON keys: ${jsonData.length}'); }  Future&lt;String> _readFileAsync() async {   final file = File(filename);   final contents = await file.readAsString();   return contents.trim(); }<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code>int value = 0; for (var i = 0; i &lt; 5000000; i++) {   value += i;   print(value); }<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 DartPad.<\/p>\n<p><strong>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u043f\u043e\u0445\u043e\u0434 \u0432 \u0441\u0435\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 <em>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440<\/em>.<\/strong><\/p>\n<p>\u0410 \u0432\u043e\u0442 <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong> \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c <strong>\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/strong> \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<blockquote>\n<p><strong>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/strong> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong> \u0432 \u0434\u0432\u0443\u0445 \u0438 \u0431\u043e\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 , \u0435\u0441\u043b\u0438 \u0442\u0435\u0431\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 :<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/337528\/\" rel=\"noopener noreferrer nofollow\"><u>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u043f\u0440\u043e\u0442\u0438\u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.blog.finotes.com\/post\/concurrency-and-parallelism-in-dart-and-how-it-is-used-in-flutter\" rel=\"noopener noreferrer nofollow\"><u>Concurrency and Parallelism in Dart and how it is used in Flutter<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/806499\/threading-vs-parallelism-how-do-they-differ\" rel=\"noopener noreferrer nofollow\"><u>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0447\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.baeldung.com\/cs\/async-vs-multi-threading\" rel=\"noopener noreferrer nofollow\"><u>The Difference Between Asynchronous and Multi-Threading<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dart.dev\/language\/concurrency\" rel=\"noopener noreferrer nofollow\"><strong><u>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435<\/u><\/strong><\/a><strong> <\/strong><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=5AxWC49ZMzs\" rel=\"noopener noreferrer nofollow\"><strong><u>\u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435<\/u><\/strong><\/a><\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 super-\u0422\u0430\u043d\u0446\u043e\u0440\u0430. Isolates<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ee6\/556\/86e\/ee655686ee2cf22c8bbed258c312a419.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee6\/556\/86e\/ee655686ee2cf22c8bbed258c312a419.png\"\/><\/figure>\n<p>\u0418 \u0442\u0430\u043a \u0435\u0441\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0430\u0439\u043d <strong>EventLoop<\/strong> (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442) \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e\u0442\u043e\u043a\u0430, \u043d\u0430 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 Dart \u0435\u0441\u0442\u044c Isolate: <\/p>\n<ul>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e isolate \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0442\u043e\u043a, \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 <strong>EventLoop<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c <strong><em>\u043f\u043e\u0442\u043e\u043a\u0435<\/em><\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e <strong><em>\u043e\u0434\u0438\u043d \u0438\u0437\u043e\u043b\u044f\u0442<\/em><\/strong>. <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0442\u043e\u043a <strong>\u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d<\/strong> \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443.  <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439,<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442\u044b<code>SendPort<\/code>  \u0438 <code>ReceivePort<\/code>  .<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043f\u043e\u0442\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 <strong>\u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c<\/strong>. \u0410 \u0418\u0437\u043e\u043b\u044f\u0442\u044b <strong>\u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/strong> \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>Isolate != \u043f\u043e\u0442\u043e\u043a<\/em>.<\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/h2>\n<p>\u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043e\u043b\u044f\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u0442\u0430\u043c, \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438. \u0422\u0430\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043a\u0430\u043a JAva,Kotlin, C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 thread \u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 dart \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Race_condition#In_software\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u043e\u0448\u0438\u0431\u043a\u0430\u043c<\/a> \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Lock_(computer_science)\" rel=\"noopener noreferrer nofollow\">\u043c\u044c\u044e\u0442\u0435\u043a\u0441\u044b \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438<\/a> \u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Race_condition#Data_race\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0433\u043e\u043d\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>, \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0432 Dart.<strong><em> <\/em><\/strong>   <\/p>\n<\/li>\n<\/ul>\n<h2>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/dart.dev\/overview#platform\" rel=\"noopener noreferrer nofollow\">\u0412\u0435\u0431-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Dart<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0442\u044b.\u00a0\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Dart \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/API\/Web_Workers_API\/Using_web_workers\" rel=\"noopener noreferrer nofollow\">web workers<\/a>\u00a0\u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0432 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c.\u00a0  <\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 UI.<\/strong> \u0421\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043a \u0432\u0441\u0435\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e <em>main thread<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f UI.  <\/p>\n<\/li>\n<li>\n<p><strong><u>\u0412\u00a0\u0438\u0437\u043e\u043b\u044f\u0442 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043b\u0438\u00a0\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b,<\/u><\/strong><u> <\/u>\u043a\u0430\u043a\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u043a\u0430\u043a\u00a0\u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438\u00a0\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u00a0\u0441\u0432\u043e\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438 \u043c\u044b \u043d\u0435\u00a0\u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e\u00a0 \u0432 dart \u0438\u0434\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.  <\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Isolate<\/h2>\n<p>\u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>compute()<\/code> \u0438\u043b\u0438 <code>Isolate.run()<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/50d\/338\/986\/50d3389864d28bfabd95d3579c2f1491.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/50d\/338\/986\/50d3389864d28bfabd95d3579c2f1491.png\"\/><\/p>\n<div><figcaption> \u0412 \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u0437\u043e\u043b\u044f\u0442.\u00a0<code>Isolate.run()<\/code>\u00a0\u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442\u0441\u044f \u0448\u0430\u0433\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0438\u0437\u043e\u043b\u044f\u0442\u043e\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438\u043c\u0438:  <\/figcaption><\/div>\n<\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 (\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442) \u0438\u0437\u043e\u043b\u044f\u0442<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0424\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0442 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0418\u0437\u043e\u043b\u044f\u0442\u0430 \u0432 \u0413\u043b\u0430\u0432\u043d\u044b\u0439 <\/h2>\n<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/98e\/e0a\/e73\/98ee0ae73e5e328777449ec53fad5201.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98e\/e0a\/e73\/98ee0ae73e5e328777449ec53fad5201.png\"\/><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \u043a\u0430\u043a \u0431\u044b \u0442\u0440\u0443\u0431\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/428\/9ec\/98d\/4289ec98d8e9d80e22fa5df1d0765bf0.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/428\/9ec\/98d\/4289ec98d8e9d80e22fa5df1d0765bf0.png\"\/><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0435\u0435, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>SendPort.<\/code><\/p>\n<blockquote>\n<p><code>SendPort<\/code>\u00a0\u043f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0432\u043e\u0439\u00a0<code>ReceivePort<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0433\u043e,\u00a0<code>Isolate<\/code>\u00a0\u0433\u0434\u0435 \u043e\u043d \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d. \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442\u00a0<code>SendPort<\/code>, \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u044d\u0442\u043e\u0442 <code>ReceivePort<\/code>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d.<\/p>\n<p> \u0423<code>ReceivePort<\/code>\u00a0(<a href=\"https:\/\/commondatastorage.googleapis.com\/dartlang-api-docs\/13991\/dart_isolate\/ReceivePort.html#ReceivePort\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u0430 \u043f\u0440\u0438\u0435\u043c\u0430<\/a>)\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u00a0<code>SendPort <\/code>(<a href=\"https:\/\/commondatastorage.googleapis.com\/dartlang-api-docs\/13991\/dart_isolate\/SendPort.html\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u043e\u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438<\/a>).  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff2\/7c5\/885\/ff27c588516f75802334182271e9d3df.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff2\/7c5\/885\/ff27c588516f75802334182271e9d3df.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/27a\/176\/e0b\/27a176e0b9c9e02f334cce53da4e9a88.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/27a\/176\/e0b\/27a176e0b9c9e02f334cce53da4e9a88.png\"\/><\/figure>\n<pre><code>import 'dart:isolate';   void main() async{   final receivePort = ReceivePort();   \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430,  \u043a\u0430\u043a \u0431\u044b \u0442\u0440\u0443\u0431\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u0430\u043d\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.    final isolate = await Isolate.spawn(count, receivePort.sendPort);   receivePort.listen((message) {     print(message);     receivePort.close();     isolate.kill();   });   print(\"Some work...\"); }   void count(SendPort sendPort) {   var result = 0;   for (var i = 1; i &lt;= 50000000000; i++) {     result = i;   }   sendPort.send(result); }<\/code><\/pre>\n<h4>\u0414\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/h4>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/plugfox.dev\/mastering-isolates\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>, \u043c\u043d\u0435 \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c, \u044f \u0435\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430.<\/p>\n<pre><code class=\"dart\">import 'dart:async'; import 'dart:isolate';  void main() => Future&lt;void>(() async {       final mainIsolatePort = ReceivePort();  \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430          final isolate = await Isolate.spawn&lt;SendPort>(         entryPoint,         mainIsolatePort.sendPort,         errorsAreFatal: true,         debugName: 'MyIsolate',       );  \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430.    \/\/ errorsAreFatal: true \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \/\/ \u043a \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430.    \/\/ debugName: 'MyIsolate' \u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u0438\u0437\u043e\u043b\u044f\u0442\u0443.        final completer = Completer&lt;SendPort>(); \/\/ \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435 \/\/(\u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 \u043f\u0440\u0438\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u043d\u0438\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u0440\u0442\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438)         mainIsolatePort.listen((message) {         if (message is SendPort) completer.complete(message);         if (message is String) print(message);       });       final send2Isolate = await completer.future;  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c SendPort.          send2Isolate.send(7);       send2Isolate.send('kjb');       send2Isolate.send(9);      \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443.        await Future&lt;void>.delayed(const Duration(seconds: 1));       mainIsolatePort.close(); \/\/ Close the ReceivePort.       isolate.kill(); \/\/ Kill the isolate.     });  void entryPoint(SendPort mainIsolatePortSend) {   final isolatePort = ReceivePort(); \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c ReceivePort \u0443 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \/\/ \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e.    mainIsolatePortSend.send(isolatePort.sendPort); \/\/ Send the SendPort to the main isolate.    isolatePort.listen((message) {     if (message is! int) return; \/\/ Ignore messages of other types.     for (var i = 1, r = 1; i &lt;= message; i++, r *= i) { \/\/ \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \/\/ \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438 \u0432 \u044d\u0442\u0443 \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.       mainIsolatePortSend.send('$i! = $r');     }   } \/\/ \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e, \u043c\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e. ); } <\/code><\/pre>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 <code>ReceivePort<\/code>,\u00a0<code>SendPort.<\/code>\u042f \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u044d\u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9f6\/45f\/701\/9f645f7013b0cc5203cacfd143f18cc5.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f6\/45f\/701\/9f645f7013b0cc5203cacfd143f18cc5.png\"\/><\/figure>\n<p>\u041f\u043e\u043c\u043d\u0438\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e<code>ReceivePort<\/code>\u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>SendPort<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442 \u043e\u0431\u0449\u0430\u043b\u0441\u044f \u0431\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0f5\/7f3\/a58\/0f57f3a5818da1efa484384397db4460.png\" width=\"1366\" height=\"768\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0f5\/7f3\/a58\/0f57f3a5818da1efa484384397db4460.png\"\/><\/figure>\n<p> <a href=\"https:\/\/api.flutter.dev\/flutter\/dart-async\/Completer-class.html\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u0440<\/a> \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 <code>sendPort<\/code> \u0438 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/998\/e19\/00f\/998e1900f81b5176b9c264bb8f1d2a7f.png\" alt=\"\u041a\u043e\u043d\u0441\u043e\u043b\u044c\" title=\"\u041a\u043e\u043d\u0441\u043e\u043b\u044c\" width=\"143\" height=\"475\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/998\/e19\/00f\/998e1900f81b5176b9c264bb8f1d2a7f.png\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043d\u0441\u043e\u043b\u044c<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0442\u044b \u0432\u0438\u0434\u0438\u0448\u044c \u0438\u0437\u043e\u043b\u044f\u0442 \u043d\u0438 \u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u0442\u0440\u043e\u043a\u0443, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0438\u0437\u043e\u043b\u044f\u0442\u043e\u043c.<\/p>\n<pre><code>send2Isolate.send(7); send2Isolate.send('kjb'); send2Isolate.send(9); <\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \ud83d\ude42<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<p>\u041e <code>Isolate.spawnUri<\/code>  \u0443\u0437\u043d\u0430\u0435\u0448\u044c \u0442\u0443\u0442: <a href=\"https:\/\/dart.dev\/language\/concurrency\" rel=\"noopener noreferrer nofollow\">https:\/\/dart.dev\/language\/concurrency<\/a><\/p>\n<p>\u041e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0442\u0443\u0442: <a href=\"https:\/\/plugfox.dev\/mastering-isolates\/\" rel=\"noopener noreferrer nofollow\">https:\/\/plugfox.dev\/mastering-isolates\/<\/a><\/p>\n<p>\u041a\u0430\u043a \u0442\u0435\u0431\u0435 \u0441\u0442\u0430\u0442\u044c\u044f?)<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756404\/\"> https:\/\/habr.com\/ru\/articles\/756404\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041d\u0443 \u0432\u043e\u0442 \u043e\u043d\u0430 \u0441\u0430\u043c\u0430\u044f <em>\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0442\u0435\u043c\u0430<\/em> \u043f\u043e \u043c\u043e\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e)<\/p>\n<h2>\u041f\u0440\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u043e\u0442\u043e\u043a\u0438<\/h2>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0442\u0430\u043d\u0446\u0430 \u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u043e\u0433\u0430\u043c\u0438 \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u0439, \u043d\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0438 \u0442\u043e\u0447\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u043c\u0438 \u0442\u0430\u043d\u0446\u043e\u0440\u0430\u043c\u0438 \u0441 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u043c\u043e\u0437\u0433\u0430. \u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b, \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0431\u044b\u0432\u0430\u044e\u0442 \u0447\u0435\u0442\u044b\u0440\u0435\u0445\u044a\u044f\u0434\u0435\u0440\u043d\u044b\u0435, \u0432\u043e\u0441\u044c\u043c\u0438\u044f\u0434\u0435\u0440\u043d\u044b\u0435 \u0438 \u0442.\u0434.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 <strong>\u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044f\u0434\u0435\u0440 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435,<\/strong> \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u043e\u0437\u0433\u043e\u0432\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043d\u0446\u043e\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0441\u044c\u043c\u0438 \u044f\u0434\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e<\/strong> \u0442\u043e\u043b\u044c\u043a\u043e 8 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0430\u043d\u0446\u043e\u0440\u044b-\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u043c\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043c\u044b, \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u043b\u044e\u0434\u0438, \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0434\u043d\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438, \u0434\u0435\u043b\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0440\u0443\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u043d\u043e\u0433\u0430\u043c\u0438.<\/p>\n<blockquote>\n<p><strong>\u041f\u0440\u043e\u0446\u0435\u0441\u0441<\/strong>\u00a0\u2014 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438\u043b\u0438\u00a0\u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f\u00a0\u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b(\u043d\u0430\u0431\u043e\u0440\u0430 \u0444\u0430\u0439\u043b\u043e\u0432) \u043d\u0430\u00a0\u041e\u0421. \u0421\u043e\u0437\u0434\u0430\u0432, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c: \u043f\u0430\u043c\u044f\u0442\u044c, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432\u0432\u043e\u0434\u0430\\\u0432\u044b\u0432\u043e\u0434\u0430, \u043a\u0430\u043c\u0435\u0440\u0430 \u0438 \u0442\u0434.<\/p>\n<p><strong>\u041f\u043e\u0442\u043e\u043a\u0438<\/strong> \u2014 <strong>\u044d\u0442\u043e<\/strong> \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (unit of execution), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435. \u0412 \u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0422\u0430\u043a\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/blockquote>\n<p><em>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c flutter-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435(\u0438\u043b\u0438 dart-\u043a\u043e\u0434) \u043e\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 <\/em><strong><em>\u043e\u0434\u043d\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435<\/em><\/strong><em> \u0438 \u0432 <\/em><strong><em>\u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435.<\/em><\/strong><\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<h2>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <\/h2>\n<p>\u0418 \u0442\u0430\u043a, \u0442\u044b \u0437\u043d\u0430\u0435\u0448\u044c async, await, Future \u0438 \u0434\u0443\u043c\u0430\u0435\u0448\u044c \u0447\u0442\u043e \u043f\u043e\u0431\u0435\u0434\u0438\u043b \u0432\u0440\u0435\u043c\u044f. <\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f  \u0438 \u0442\u044b \u0443\u0432\u0438\u0434\u0438\u0448\u044c, \u043a\u0430\u043a \u0442\u0432\u043e\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0437\u0430\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442, \u0430 \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d. <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"dart\">const String filename = 'with_keys.json';  void main() async {   \/\/ Read some data.   final fileData = await _readFileAsync();    \/\/ \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \/\/ \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f      final jsonData = jsonDecode(fileData);    \/\/ Use that data.   print('Number of JSON keys: ${jsonData.length}'); }  Future&lt;String> _readFileAsync() async {   final file = File(filename);   final contents = await file.readAsString();   return contents.trim(); }<\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code>int value = 0; for (var i = 0; i &lt; 5000000; i++) {   value += i;   print(value); }<\/code><\/pre>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432 DartPad.<\/p>\n<p><strong>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u043f\u043e\u0445\u043e\u0434 \u0432 \u0441\u0435\u0442\u044c \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0433\u0434\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 <em>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440<\/em>.<\/strong><\/p>\n<p>\u0410 \u0432\u043e\u0442 <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong> \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c <strong>\u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/strong> \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<blockquote>\n<p><strong>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/strong> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435, <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong> \u0432 \u0434\u0432\u0443\u0445 \u0438 \u0431\u043e\u043b\u0435\u0435.<\/p>\n<\/blockquote>\n<p>\u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043f\u0443\u0442\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>\u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 , \u0435\u0441\u043b\u0438 \u0442\u0435\u0431\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 :<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/articles\/337528\/\" rel=\"noopener noreferrer nofollow\"><u>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u043f\u0440\u043e\u0442\u0438\u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0442\u0438\u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u0440\u0430\u0437\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.blog.finotes.com\/post\/concurrency-and-parallelism-in-dart-and-how-it-is-used-in-flutter\" rel=\"noopener noreferrer nofollow\"><u>Concurrency and Parallelism in Dart and how it is used in Flutter<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/806499\/threading-vs-parallelism-how-do-they-differ\" rel=\"noopener noreferrer nofollow\"><u>\u041c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0442\u0438\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0447\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f?<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.baeldung.com\/cs\/async-vs-multi-threading\" rel=\"noopener noreferrer nofollow\"><u>The Difference Between Asynchronous and Multi-Threading<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/dart.dev\/language\/concurrency\" rel=\"noopener noreferrer nofollow\"><strong><u>\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435<\/u><\/strong><\/a><strong> <\/strong><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=5AxWC49ZMzs\" rel=\"noopener noreferrer nofollow\"><strong><u>\u041a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435<\/u><\/strong><\/a><\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 super-\u0422\u0430\u043d\u0446\u043e\u0440\u0430. Isolates<\/h2>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0442\u0430\u043a \u0435\u0441\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0430\u0439\u043d <strong>EventLoop<\/strong> (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442) \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043f\u043e\u0442\u043e\u043a\u0430, \u043d\u0430 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 Dart \u0435\u0441\u0442\u044c Isolate: <\/p>\n<ul>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e isolate \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0442\u043e\u043a, \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 <strong>EventLoop<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c <strong><em>\u043f\u043e\u0442\u043e\u043a\u0435<\/em><\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e <strong><em>\u043e\u0434\u0438\u043d \u0438\u0437\u043e\u043b\u044f\u0442<\/em><\/strong>. <\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0442\u043e\u043a <strong>\u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d<\/strong> \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443.  <\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439,<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442\u044b<code>SendPort<\/code>  \u0438 <code>ReceivePort<\/code>  .<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043f\u043e\u0442\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 <strong>\u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c<\/strong>. \u0410 \u0418\u0437\u043e\u043b\u044f\u0442\u044b <strong>\u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/strong> \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <em>Isolate != \u043f\u043e\u0442\u043e\u043a<\/em>.<\/p>\n<\/blockquote>\n<h2>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430<\/h2>\n<p>\u0442\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043e\u043b\u044f\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u0442\u0430\u043c, \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438. \u0422\u0430\u043a\u0438\u0435 \u044f\u0437\u044b\u043a\u0438 \u043a\u0430\u043a JAva,Kotlin, C++ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 thread \u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 dart \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b:<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0441 \u043e\u0431\u0449\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c <a href=\"https:\/\/en.wikipedia.org\/wiki\/Race_condition#In_software\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d \u043e\u0448\u0438\u0431\u043a\u0430\u043c<\/a> \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Lock_(computer_science)\" rel=\"noopener noreferrer nofollow\">\u043c\u044c\u044e\u0442\u0435\u043a\u0441\u044b \u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438<\/a> \u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Race_condition#Data_race\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0435\u0433\u043e\u043d\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>, \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u0432 Dart.<strong><em> <\/em><\/strong>   <\/p>\n<\/li>\n<\/ul>\n<h2>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/dart.dev\/overview#platform\" rel=\"noopener noreferrer nofollow\">\u0412\u0435\u0431-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Dart<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0442\u044b.\u00a0\u0412\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Dart \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u00a0<a href=\"https:\/\/developer.mozilla.org\/docs\/Web\/API\/Web_Workers_API\/Using_web_workers\" rel=\"noopener noreferrer nofollow\">web workers<\/a>\u00a0\u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0432 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c.\u00a0  <\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 UI.<\/strong> \u0421\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043a \u0432\u0441\u0435\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e <em>main thread<\/em>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f UI.  <\/p>\n<\/li>\n<li>\n<p><strong><u>\u0412\u00a0\u0438\u0437\u043e\u043b\u044f\u0442 \u043c\u043e\u0436\u0435\u0442\u00a0\u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043b\u0438\u00a0\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434\u044b,<\/u><\/strong><u> <\/u>\u043a\u0430\u043a\u00a0\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0434\u043b\u044f\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u043a\u0430\u043a\u00a0\u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438\u00a0\u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u00a0\u0441\u0432\u043e\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438 \u043c\u044b \u043d\u0435\u00a0\u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u00a0\u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438 \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u043e\u00a0 \u0432 dart \u0438\u0434\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.  <\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Isolate<\/h2>\n<p>\u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>compute()<\/code> \u0438\u043b\u0438 <code>Isolate.run()<\/code><\/p>\n<figure class=\"full-width\">\n<div><figcaption> \u0412 \u044d\u0442\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0438\u0437\u043e\u043b\u044f\u0442.\u00a0<code>Isolate.run()<\/code>\u00a0\u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442\u0441\u044f \u0448\u0430\u0433\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0438\u0437\u043e\u043b\u044f\u0442\u043e\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438\u043c\u0438:  <\/figcaption><\/div>\n<\/figure>\n<ol>\n<li>\n<p>\u041f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 (\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442) \u0438\u0437\u043e\u043b\u044f\u0442<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0424\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442<\/strong><\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0442 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <strong>\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0442<\/strong><\/p>\n<\/li>\n<\/ol>\n<h2>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u0418\u0437\u043e\u043b\u044f\u0442\u0430 \u0432 \u0413\u043b\u0430\u0432\u043d\u044b\u0439 <\/h2>\n<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \u043a\u0430\u043a \u0431\u044b \u0442\u0440\u0443\u0431\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0435\u0435, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <code>SendPort.<\/code><\/p>\n<blockquote>\n<p><code>SendPort<\/code>\u00a0\u043f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0432\u043e\u0439\u00a0<code>ReceivePort<\/code>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0442\u043e\u0433\u043e,\u00a0<code>Isolate<\/code>\u00a0\u0433\u0434\u0435 \u043e\u043d \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d. \u041b\u044e\u0431\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442\u00a0<code>SendPort<\/code>, \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u00a0\u044d\u0442\u043e\u0442 <code>ReceivePort<\/code>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d.<\/p>\n<p> \u0423<code>ReceivePort<\/code>\u00a0(<a href=\"https:\/\/commondatastorage.googleapis.com\/dartlang-api-docs\/13991\/dart_isolate\/ReceivePort.html#ReceivePort\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u0430 \u043f\u0440\u0438\u0435\u043c\u0430<\/a>)\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u00a0<code>SendPort <\/code>(<a href=\"https:\/\/commondatastorage.googleapis.com\/dartlang-api-docs\/13991\/dart_isolate\/SendPort.html\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0440\u0442\u043e\u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438<\/a>).  <\/p>\n<\/blockquote>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<pre><code>import 'dart:isolate';   void main() async{   final receivePort = ReceivePort();   \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430,  \u043a\u0430\u043a \u0431\u044b \u0442\u0440\u0443\u0431\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u0430\u043d\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.    final isolate = await Isolate.spawn(count, receivePort.sendPort);   receivePort.listen((message) {     print(message);     receivePort.close();     isolate.kill();   });   print(\"Some work...\"); }   void count(SendPort sendPort) {   var result = 0;   for (var i = 1; i &lt;= 50000000000; i++) {     result = i;   }   sendPort.send(result); }<\/code><\/pre>\n<h4>\u0414\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/h4>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <a href=\"https:\/\/plugfox.dev\/mastering-isolates\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a>, \u043c\u043d\u0435 \u043e\u043d \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c, \u044f \u0435\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430.<\/p>\n<pre><code class=\"dart\">import 'dart:async'; import 'dart:isolate';  void main() => Future&lt;void>(() async {       final mainIsolatePort = ReceivePort();  \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430          final isolate = await Isolate.spawn&lt;SendPort>(         entryPoint,         mainIsolatePort.sendPort,         errorsAreFatal: true,         debugName: 'MyIsolate',       );  \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430.    \/\/ errorsAreFatal: true \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043d\u0435\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443\u0442 \/\/ \u043a \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430.    \/\/ debugName: 'MyIsolate' \u0434\u0430\u0435\u0442 \u0438\u043c\u044f \u0438\u0437\u043e\u043b\u044f\u0442\u0443.        final completer = Completer&lt;SendPort>(); \/\/ \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u0440 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043d\u0438\u0436\u0435 \/\/(\u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 \u043f\u0440\u0438\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u043d\u0438\u0435 \u0441 \u0435\u0433\u043e \u043f\u043e\u0440\u0442\u043e\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438)         mainIsolatePort.listen((message) {         if (message is SendPort) completer.complete(message);         if (message is String) print(message);       });       final send2Isolate = await completer.future;  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c SendPort.          send2Isolate.send(7);       send2Isolate.send('kjb');       send2Isolate.send(9);      \/\/ \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443.        await Future&lt;void>.delayed(const Duration(seconds: 1));       mainIsolatePort.close(); \/\/ Close the ReceivePort.       isolate.kill(); \/\/ Kill the isolate.     });  void entryPoint(SendPort mainIsolatePortSend) {   final isolatePort = ReceivePort(); \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c ReceivePort \u0443 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \/\/ \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e.    mainIsolatePortSend.send(isolatePort.sendPort); \/\/ Send the SendPort to the main isolate.    isolatePort.listen((message) {     if (message is! int) return; \/\/ Ignore messages of other types.     for (var i = 1, r = 1; i &lt;= message; i++, r *= i) { \/\/ \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u0438\u0437\u043e\u043b\u044f\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430, \/\/ \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438 \u0432 \u044d\u0442\u0443 \u0432\u0445\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.       mainIsolatePortSend.send('$i! = $r');     }   } \/\/ \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u043f\u043e\u0440\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e, \u043c\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e. ); } <\/code><\/pre>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 <code>ReceivePort<\/code>,\u00a0<code>SendPort.<\/code>\u042f \u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u044d\u0442\u043e \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u043c\u043d\u0438\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e<code>ReceivePort<\/code>\u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <code>SendPort<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043c\u043e\u0433\u043b\u0430 \u0431\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u043e\u0432\u044b\u0439 \u0438\u0437\u043e\u043b\u044f\u0442 \u043e\u0431\u0449\u0430\u043b\u0441\u044f \u0431\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p> <a href=\"https:\/\/api.flutter.dev\/flutter\/dart-async\/Completer-class.html\" rel=\"noopener noreferrer nofollow\">\u041a\u043e\u043c\u043f\u043b\u0438\u0442\u043e\u0440<\/a> \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u043b\u044f\u0442\u0430 <code>sendPort<\/code> \u0438 \u0437\u0430\u0442\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<figure class=\"bordered\">\n<div><figcaption>\u041a\u043e\u043d\u0441\u043e\u043b\u044c<\/figcaption><\/div>\n<\/figure>\n<p>\u041a\u0430\u043a \u0442\u044b \u0432\u0438\u0434\u0438\u0448\u044c \u0438\u0437\u043e\u043b\u044f\u0442 \u043d\u0438 \u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u0442\u0440\u043e\u043a\u0443, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0438\u0437\u043e\u043b\u044f\u0442\u043e\u043c.<\/p>\n<pre><code>send2Isolate.send(7); send2Isolate.send('kjb'); send2Isolate.send(9); <\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e \ud83d\ude42<\/p>\n<p>\u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<p>\u041e <code>Isolate.spawnUri<\/code>  \u0443\u0437\u043d\u0430\u0435\u0448\u044c \u0442\u0443\u0442: <a href=\"https:\/\/dart.dev\/language\/concurrency\" rel=\"noopener noreferrer nofollow\">https:\/\/dart.dev\/language\/concurrency<\/a><\/p>\n<p>\u041e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u0437\u043e\u043b\u044f\u0442\u0430\u043c\u0438 \u0442\u0443\u0442: <a href=\"https:\/\/plugfox.dev\/mastering-isolates\/\" rel=\"noopener noreferrer nofollow\">https:\/\/plugfox.dev\/mastering-isolates\/<\/a><\/p>\n<p>\u041a\u0430\u043a \u0442\u0435\u0431\u0435 \u0441\u0442\u0430\u0442\u044c\u044f?)<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756404\/\"> https:\/\/habr.com\/ru\/articles\/756404\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-352951","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352951"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352951\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}