{"id":1583,"date":"2025-11-20T10:24:30","date_gmt":"2025-11-20T10:24:30","guid":{"rendered":"https:\/\/varnagame.site\/?p=1583"},"modified":"2026-02-25T09:05:12","modified_gmt":"2026-02-25T09:05:12","slug":"%d0%bf%d0%b0%d1%80%d0%b0%d0%bb%d0%bb%d0%b5%d0%bb%d1%8c%d0%bd%d0%be%d0%b5-%d0%bf%d1%80%d0%be%d0%b3%d1%80%d0%b0%d0%bc%d0%bc%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d0%bd%d0%b8%d0%b5-%d0%b8-%d0%b1%d0%b8%d0%b1-2","status":"publish","type":"post","link":"https:\/\/varnagame.site\/?p=1583","title":{"rendered":"\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 TPL (\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c Task)"},"content":{"rendered":"\n<p>\u041e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e &#8211; \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<br> \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 Main:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>var outer = Task.Factory.StartNew(() =&gt;      \/\/ \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0430\n{\n    Console.WriteLine(&quot;Outer task starting...&quot;);\n    var inner = Task.Factory.StartNew(() =&gt;  \/\/ \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430\n    {\n        Console.WriteLine(&quot;Inner task starting...&quot;);\n        Thread.Sleep(2000);\n        Console.WriteLine(&quot;Inner task finished.&quot;);\n    });\n});\nouter.Wait(); \/\/ \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438\nConsole.WriteLine(&quot;End of Main&quot;);<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Outer task starting...\nEnd of Main<\/code><\/pre><\/div>\n\n\n\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0435\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&nbsp;<strong>TaskCreationOptions.AttachedToParent<\/strong>: \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0430 \u043a \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0418 \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0435 \u043a \u043d\u0435\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>var outer = Task.Factory.StartNew(() =&gt;      \/\/ \u0432\u043d\u0435\u0448\u043d\u044f\u044f \u0437\u0430\u0434\u0430\u0447\u0430\n{\n    Console.WriteLine(&quot;Outer task starting...&quot;);\n    var inner = Task.Factory.StartNew(() =&gt;  \/\/ \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430\n    {\n        Console.WriteLine(&quot;Inner task starting...&quot;);\n        Thread.Sleep(2000);\n        Console.WriteLine(&quot;Inner task finished.&quot;);\n    }, TaskCreationOptions.AttachedToParent);\n});\nouter.Wait(); \/\/ \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438\nConsole.WriteLine(&quot;End of Main&quot;);<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>Outer task starting...\nInner task starting...\nInner task finished.\nEnd of Main<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u0434\u0430\u0447<\/h2>\n\n\n\n<p>\u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u0434\u0430\u0447. \u041c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044a\u0435\u043a\u0442 Task:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Task[] tasks1 = new Task[3]\n{\n    new Task(() =&gt; Console.WriteLine(&quot;First Task&quot;)),\n    new Task(() =&gt; Console.WriteLine(&quot;Second Task&quot;)),\n    new Task(() =&gt; Console.WriteLine(&quot;Third Task&quot;))\n};\n\/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u0437\u0430\u0434\u0430\u0447 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435\nforeach (var t in tasks1)\n    t.Start();<\/code><\/pre><\/div>\n\n\n\n<p>\u041b\u0438\u0431\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b Task.Factory.StartNew \u0438\u043b\u0438 Task.Run \u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>sk[] tasks2 = new Task[3];\nint j = 1;\nfor (int i = 0; i &lt; tasks2.Length; i++)\n    tasks2[i] = Task.Factory.StartNew(() =&gt; Console.WriteLine($&quot;Task {j++}&quot;));<\/code><\/pre><\/div>\n\n\n\n<p>\u041d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 Main, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e  \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a\u043e\u0434 \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u0441\u044f, \u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u00a0<strong>Task.WaitAll(tasks)<\/strong>: <br>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Task[] tasks = new Task[3];\nfor(var i = 0; i &lt; tasks.Length; i++)\n{\n    tasks[i] = new Task(() =&gt;\n    {\n        Thread.Sleep(1000); \/\/ \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u043e\u043b\u0433\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b\n        Console.WriteLine($&quot;Task{i} finished&quot;);\n    });\n    tasks[i].Start();   \/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443\n}\nConsole.WriteLine(&quot;\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 Main&quot;);\n \nTask.WaitAll(tasks); \/\/ \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><br>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>int n1 =4, n2 = 5;\nTask&lt;int&gt; sumTask = new Task&lt;int&gt;(() =&gt; Sum(n1, n2));\nsumTask.Start();\n \nint result = sumTask.Result;\nConsole.WriteLine($&quot;{n1} + {n2} = {result}&quot;); \/\/ 4 + 5 = 9\n \nint Sum(int a, int b) =&gt; a + b;<\/code><\/pre><\/div>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u0437\u0430\u0434\u0430\u0447\u0438  \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 Task \u0442\u0435\u043c \u0442\u0438\u043f\u043e\u043c, \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0437\u0430\u0434\u0430\u0447\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0438\u0437 \u0437\u0430\u0434\u0430\u0447\u0438 sumTask \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0442\u0438\u043f\u0430 int, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Task \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c &#8211;\u00a0<code>Task&lt;int><\/code>.<\/p>\n\n\n\n<p>\u0418, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u0422\u0430\u043a, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434&nbsp;<code>Sum<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0438 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0445 \u0441\u0443\u043c\u043c\u0443 &#8211; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 int.<\/p>\n\n\n\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 Result:\u00a0<code>sumTask.Result<\/code>. \u041d\u0430\u043c \u043d\u0435 \u043d\u0430\u0434\u043e \u0435\u0433\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u0442\u0438\u043f\u0443 int, \u043e\u043d\u043e \u0443\u0436\u0435 \u0441\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0438\u0441\u043b\u043e. <br>\u041f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 Result \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n\n\n\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\"><code>Task&lt;Person&gt; defaultPersonTask = new Task&lt;Person&gt;(() =&gt; new Person(&quot;Tom&quot;, 37));\ndefaultPersonTask.Start();\n \nPerson defaultPerson = defaultPersonTask.Result;\nConsole.WriteLine($&quot;{defaultPerson.Name} - {defaultPerson.Age}&quot;); \/\/ Tom - 37\n \nrecord class Person(string Name, int Age); <\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0443\u044e &#8211; \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,6],"tags":[],"_links":{"self":[{"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/posts\/1583"}],"collection":[{"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/varnagame.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1583"}],"version-history":[{"count":2,"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/posts\/1583\/revisions"}],"predecessor-version":[{"id":1586,"href":"https:\/\/varnagame.site\/index.php?rest_route=\/wp\/v2\/posts\/1583\/revisions\/1586"}],"wp:attachment":[{"href":"https:\/\/varnagame.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/varnagame.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/varnagame.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}