{"id":305303,"date":"2020-06-14T09:00:18","date_gmt":"2020-06-14T09:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305303"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305303","title":{"rendered":"\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c: Python vs FSM"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506604\/\">\u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u043d\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e Python. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432\u0437\u044f\u0432\u0448\u0438\u0441\u044c \u0437\u0430 \u0435\u0433\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443 GIL, \u0432\u044b\u0448\u0435\u043b \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/post\/84629\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u00ab\u043d\u0435\u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043c\u044b\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439\u00bb \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Python. \u0412\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 (Finite-state machine \u0438\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e FSM) \u0432 \u0441\u0440\u0435\u0434\u0435 \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e) \u2014 \u0412\u041a\u041f(\u0430).<\/p>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e <b>\u043b\u044e\u0431\u0430\u044f<\/b> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u044b \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443, \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0438\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f Python, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 Python \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430, \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u00ab\u043c\u0438\u0441\u0442\u0438\u043a\u043e\u0439\u00bb. <\/p>\n<p>  \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0435\u0441\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 CPU \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u0442\u044c (\u0432 \u044d\u0442\u043e\u043c \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f). \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u044f\u0437\u044b\u043a\u0430\u0445, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u043d\u0430 \u043e\u0442 \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c Python, \u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u0438\u043c\u0435\u0435\u0442 \u0434\u0440\u0443\u0433\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 \u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <i>\u041a\u0430\u043a\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043c\u0438\u0441\u0442\u0438\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430\u00bb<\/i>. <br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041a\u043e\u0434 \u043d\u0430 Python, \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0430\u0445 1 \u0438 2. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u00ab\u043e\u0431\u0435\u0440\u0442\u043a\u0443\u00bb, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 (\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0435\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u0430 \u0441 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u0432 Python). <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 1. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 CPU \u043d\u0430 Python<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">import time  def count(n):   st_time = time.time()   while n &gt; 0:     n -= 1   t = time.time() - st_time   print(&quot;speed CPU------%s---&quot; % t)   return t  def TestTime(fn, n):   def wrapper(*args):     tsum=0     st = time.time()     i=1     while (i&lt;=n):       t = fn(*args)       tsum +=t       i +=1     return tsum   return wrapper  test1 = TestTime(count, 2) tt = test1(100000000) print(&quot;Total ---%s seconds ---&quot; % tt) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 2. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 CPU<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> import time from threading import Thread def count(n):   start_time = time.time()   while n &gt; 0:     n -= 1   print(&quot;speed CPU-%s seconds ---&quot; % (time.time() - start_time))  k = 2 while k &gt; 0:   print(&quot;k=%d &quot; % k)   t1 = Thread(target=count,args=(100000000,)); t1.start()   t2 = Thread(target=count,args=(100000000,)); t2.start()   t1.join();   t2.join();   k -= 1 <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0420\u0438\u0441.1 \u0438 \u0440\u0438\u0441.2 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432 \u0442\u0435\u0441\u0442\u0430 (Python 3.8.3 64-bit) \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 Intel&reg; Core(TM) CPU @2.5 GHz, \u041e\u0417\u0423 6.0 \u0413\u0411. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<br \/>  \u2022 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u2014 14.221 \u0441\u0435\u043a<br \/>  \u2022 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u2014 13.995 \u0441\u0435\u043a<\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e GIL (\u0434\u0430\u043b\u0435\u0435 \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435) \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e 24.6 \u0441\u0435\u043a \u0438 45.5 \u0441\u0435\u043a. \u041e\u0431\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0412 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044d\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0434\u0435\u043b\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u043b\u043e\u0441\u044c, \u0445\u043e\u0442\u044f \u0431\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430 (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uo\/mk\/w6\/uomkw6xfskl2xmcvhqzzuqo1yrk.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.1. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w6\/il\/dw\/w6ildwbdjwthschinfwkvvh66vc.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.2. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u043f\u043e\u0442\u043e\u043a\u0430, \u0442\u043e \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e (\u0441\u043c. \u0440\u0438\u0441. 3). \u0418\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432\u0435\u0434\u0435\u0442 \u043a \u043a\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043b\u0435\u0437\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442, \u0442\u043e \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f Python \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u043c\u0438\u0441\u0442\u0438\u043a\u0430.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r7\/lw\/rm\/r7lwrmuef38balputxp2u0vuguc.jpeg\" alt=\"image\"> <br \/>  \u0420\u0438\u0441.3. \u0422\u0435\u0441\u0442 CPU \u043d\u0430 \u0442\u0440\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python<\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u0441\u0440\u0435\u0434\u0435 \u0412\u041a\u041f(\u0430), \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0432\u043d\u0435 \u0435\u0435. \u042d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0434\u0435\u043b\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 \u0433\u0440\u0430\u0444\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441. 4. \u0418\u0437 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 (\u0441\u043c., \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <a href=\"https:\/\/habr.com\/ru\/post\/160105\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>) \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u2014 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439, SWITCH-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0435\u0439 \u0441\u043c. \u043d\u0430 <a href=\"http:\/\/is.ifmo.ru\/\" rel=\"nofollow\">\u0441\u0430\u0439\u0442\u0435 \u0418\u0422\u041c\u041e<\/a>). <\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 Python \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u0421++. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0433\u0440\u0430\u0444\u0443 \u043a\u043e\u0434 \u043d\u0430 \u0421++ \u0441 \u043a\u043e\u0434\u043e\u043c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0441\u043c. \u0444\u0443\u043d\u043a\u0446\u0438\u044e main) \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 3.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8l\/io\/zk\/8liozkw_9cogioozutoi3xsadoq.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.4. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 3. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u0421++<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> class FsmCount { public:     FsmCount(int n) { nCount = n; nState = 0; };     void ExecOneStep();     int nState; protected:     int nCount;     int x1();     void y1(); };  #include &quot;FsmCount.h&quot;  int FsmCount::x1() { return nCount &gt; 0; } void FsmCount::y1() { nCount--; } void FsmCount::ExecOneStep() {     switch (nState) {     case 0:         if (x1())             y1();         else nState = 1;         break;     } }  #include &lt;QCoreApplication&gt; #include &lt;QTime&gt; #include &quot;FsmCount.h&quot;  int main(int argc, char *argv[]) {     QCoreApplication a(argc, argv);      QTime time;     FsmCount *pFsmCount{nullptr};      pFsmCount = new FsmCount(100000000);     time.start();     while (!pFsmCount-&gt;nState)         pFsmCount-&gt;ExecOneStep();     double dTime = QString::number(time.elapsed()).toDouble();     printf(&quot;%f&quot;, dTime);     if (pFsmCount) delete pFsmCount;      return a.exec(); } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 250 \u043c\u0441\u0435\u043a. \u042d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 55 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043a\u043e\u0434\u043e\u043c Python. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e \u0441 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (\u0441\u043c. \u0440\u0438\u0441.2). <\/p>\n<p>  \u041d\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0435\u0449\u0435 \u0431\u043e\u043b\u044c\u0448\u0435, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c, \u043d\u0435 \u0432\u044b\u0445\u043e\u0434\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\/\u043c\u0435\u0442\u043e\u0434\u0430 y1 (\u0441\u043c. \u043b\u0438\u0441\u0442\u0438\u043d\u0433 4). \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u0430\u0441\u044c \u0434\u043e \u043c\u0435\u043d\u0435\u0435 \u0447\u0435\u043c 1 \u043c\u0441\u0435\u043a (\u0442\u043e\u0447\u043d\u0435\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u0442.\u043a. \u0442\u0435\u0441\u0442 \u0432\u044b\u0434\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e\u0435 \u043d\u0443\u043b\u044e). \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u0430\u0436\u0435 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 14000 (!) \u0440\u0430\u0437 \u0432\u044b\u0448\u0435, \u0447\u0435\u043c \u043d\u0430 Python. \u0421\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0421++ \u043e\u0442\u0434\u0430\u044e\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u0445 \u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 4. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 FsmCount<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> void FsmCount::y1() {     while (nCount&gt;0)         nCount--; } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041d\u0430\u0448\u0430 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u0446\u0435\u043b\u044c \u2014 <i>\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Python \u0441\u043e \u0441\u0440\u0435\u0434\u043e\u0439 \u0412\u041a\u041f(\u0430)<\/i>. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, \u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435, \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430 \u0440\u0438\u0441. 4. \u0415\u0433\u043e \u043a\u043e\u0434 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 5. <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 5. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0442\u0435\u0441\u0442\u0430 CPU<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;lfsaappl.h&quot; #include &lt;QTime&gt;  class FCount :     public LFsaAppl { public:     LFsaAppl* Create(CVarFSA *pCVF) { Q_UNUSED(pCVF)return new FCount(nameFsa); }     bool FCreationOfLinksForVariables();     FCount(string strNam);     CVar *pVarCount;     CVar *pVarExtVarCount{nullptr};     CVar *pVarStrNameExtVarCount;     CVar *pVarWorkingHours; protected:     int x1(); int x12();     void y1(); void y2(); void y3(); void y12();     QTime time; };  #include &quot;stdafx.h&quot; #include &quot;FCount.h&quot;  static LArc TBL_Count[] = {     LArc(&quot;st&quot;,\t&quot;st&quot;,&quot;^x12&quot;,&quot;y12&quot;),     LArc(&quot;st&quot;,\t&quot;s1&quot;,&quot;x12&quot;, &quot;y2&quot;),     LArc(&quot;s1&quot;,\t&quot;s1&quot;,&quot;x1&quot;,  &quot;y1&quot;),     LArc(&quot;s1&quot;,\t&quot;st&quot;,&quot;^x1&quot;, &quot;y3&quot;),     LArc() };  FCount::FCount(string strNam):     LFsaAppl(TBL_Count, strNam) { }  bool FCount::FCreationOfLinksForVariables() {     pVarCount = CreateLocVar(&quot;n&quot;, CLocVar::vtInteger, &quot;local counter&quot;);     pVarStrNameExtVarCount = CreateLocVar(&quot;strNameExtVarCount&quot;, CLocVar::vtString, &quot;external counter name&quot;);;     string str = pVarStrNameExtVarCount-&gt;strGetDataSrc();     if (str != &quot;&quot;) { pVarExtVarCount = pTAppCore-&gt;GetAddressVar(pVarStrNameExtVarCount-&gt;strGetDataSrc().c_str(), this); }     pVarWorkingHours  = CreateLocVar(&quot;strWorkingHours&quot;, CLocVar::vtString, &quot;working hours&quot;);     return true; }  int FCount::x1() { return pVarCount-&gt;GetDataSrc() &gt; 0; }  int FCount::x12() { return pVarExtVarCount != nullptr; }  void FCount::y1() {     int n = int(pVarCount-&gt;GetDataSrc());     pVarCount-&gt;SetDataSrc(this, --n); }  void FCount::y2() {     time.start();     pVarCount-&gt;SetDataSrc(this, pVarExtVarCount-&gt;GetDataSrc()); }  void FCount::y3() {     pVarWorkingHours-&gt;SetDataSrc(nullptr, QString::number(time.elapsed()).toStdString(), nullptr); }  void FCount::y12() { FInit(); } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u0441\u0442\u0430 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 5.35 \u0441\u0435\u043a \u043f\u0440\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0438\u043a\u043b\u043e\u0432 100000. \u0422.\u0435. \u043e\u043d, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <b>\u0431\u044b\u0441\u0442\u0440\u043e\u043c<\/b> \u0421++, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 2600 \u0440\u0430\u0437 (!?) \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430 \u043d\u0430 Python. \u0422\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0433\u043e\u0440\u0447\u0430\u0442\u044c \ud83d\ude41 \u041d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0432\u043d\u043e 0.0535 \u043c\u0441\u0435\u043a. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u041f\u041b\u041a \u0442\u0438\u043f\u0430 \u041e\u0412\u0415\u041d-100 \u0440\u0430\u0432\u0435\u043d 1 \u043c\u0441\u0435\u043a, \u0430 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u044b\u0439. \u0425\u043e\u0442\u044f, \u0435\u0449\u0435 \u0440\u0430\u0437, \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0410\u041f, \u0442.\u043a. \u0438 \u043a\u043e\u0434 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439, \u0434\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0442\u0440\u0435\u0432\u043e\u0433\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0447\u0438\u0441\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447). <\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0421++ \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0412\u041a\u041f(\u0430) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438. \u041b\u0438\u0441\u0442\u0438\u043d\u0433 6 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 QThread \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Qt. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u0440\u0435\u043c\u044f \u0443\u043f\u0430\u043b\u043e \u0434\u043e 70-80 \u043c\u0441\u0435\u043a \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0446\u0438\u043a\u043b\u043e\u0432 \u0434\u043e 100000000. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0435\u0441\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0442\u043e\u043a, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0443\u0436\u0435 \u0432 200 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 Python. <\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0442\u0435\u0441\u0442\u0430, \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0441\u043e \u0441\u0440\u0435\u0434\u043e\u0439 \u0412\u041a\u041f(\u0430). \u0415\u0441\u043b\u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443:   <\/p>\n<pre><code class=\"cpp\">while (bIfExecuteStep) { bIfExecuteStep = false; }, <\/code><\/pre>\n<p>  \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u00ab\u0440\u0443\u0445\u043d\u0435\u0442\u00bb \u0434\u043e 1 \u043c\u0441\u0435\u043a \u0438 \u043c\u0435\u043d\u0435\u0435. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a Python \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0448\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 14000 \u0440\u0430\u0437. <\/p>\n<p>  <i><b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 1.<\/b> \u0424\u043b\u0430\u0433 bIfExecuteStep \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043e\u0439 \u0412\u041a\u041f(\u0430). \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u044e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u0430. \u0412\u0432\u0435\u0434\u0435\u043d \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<br \/>  <\/i><\/p>\n<p>  \u0421 \u0446\u0435\u043b\u044c\u044e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u0438 \u043f\u043e\u0442\u043e\u043a\u0430, \u0433\u0434\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u2014 \u0435\u0433\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043d\u043e \u0438 \u043c\u044b \u0440\u0435\u0448\u0430\u043b\u0438 \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438 \u0440\u0435\u0448\u0438\u043b\u0438. <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 6. \u0422\u0435\u0441\u0442 CPU \u043d\u0430 \u0431\u0430\u0437\u0435 \u043f\u043e\u0442\u043e\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;lfsaappl.h&quot; #include &lt;QThread&gt; #include &lt;QTime&gt;  class QCount; class ThCount : public QThread {     Q_OBJECT public:     ThCount(QCount *p, QObject *parent); protected:     bool bIfRun{false};     bool bIfStop{false};     bool bIfExecuteStep{false};     QCount *pQCount;     void run(); friend class QCount; };  class QCount :     public LFsaAppl { public:     void ExecuteThreadStep();     void WaitForThreadToFinish();     LFsaAppl* Create(CVarFSA *pCVF) { Q_UNUSED(pCVF)return new QCount(nameFsa); }     bool FCreationOfLinksForVariables();     QCount(string strNam);     virtual ~QCount(void);     ThCount  *pThCount{nullptr};     CVar *pVarCount;     CVar *pVarExtVarCount;     CVar *pVarStrNameExtVarCount;     CVar *pVarWorkingHours;  protected:     int x1(); int x12();     void y1(); void y2(); void y12();     QTime time;  friend class ThCount; };  #include &quot;stdafx.h&quot; #include &quot;QCount.h&quot; #include &lt;QTimer&gt;  static LArc TBL_Count[] = {     LArc(&quot;st&quot;,\t\t&quot;st&quot;,&quot;^x12&quot;,&quot;y12&quot;),\t\t\t\/\/     LArc(&quot;st&quot;,\t\t&quot;s2&quot;,&quot;x12&quot;,\t&quot;y1&quot;),\t\t\t\/\/     LArc(&quot;s2&quot;,\t\t&quot;s3&quot;,&quot;^x1&quot;,\t&quot;y2&quot;),\t\t\t\/\/     LArc(&quot;s3&quot;,\t\t&quot;s2&quot;,&quot;^x1&quot;,\t&quot;--&quot;),\t\t\t\/\/     LArc() };  QCount::QCount(string strNam):     LFsaAppl(TBL_Count, strNam, nullptr, nullptr) { }  QCount::~QCount(void) { }  bool QCount::FCreationOfLinksForVariables() {     pVarCount = CreateLocVar(&quot;n&quot;, CLocVar::vtInteger, &quot;local counter&quot;);     pVarExtVarCount = nullptr;     pVarStrNameExtVarCount = CreateLocVar(&quot;strNameExtVarCount&quot;, CLocVar::vtString, &quot;external counter name&quot;);;     string str = pVarStrNameExtVarCount-&gt;strGetDataSrc();     if (str != &quot;&quot;) { pVarExtVarCount = pTAppCore-&gt;GetAddressVar(pVarStrNameExtVarCount-&gt;strGetDataSrc().c_str(), this); }     pVarWorkingHours  = CreateLocVar(&quot;strWorkingHours&quot;, CLocVar::vtString, &quot;working hours&quot;);     return true; }  void QCount::ExecuteThreadStep() { if (pThCount) pThCount-&gt;bIfExecuteStep = true; }  void QCount::WaitForThreadToFinish() {     if (pThCount) {         \/\/ \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a         pThCount-&gt;bIfRun = false;         pThCount-&gt;quit();         pThCount-&gt;wait(500);         pThCount-&gt;terminate();     }     delete pThCount; }   int QCount::x1() { return pVarCount-&gt;GetDataSrc() &gt; 0; }  int QCount::x12() { return pVarExtVarCount != nullptr; } \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u043e\u0442\u043e\u043a void QCount::y1() {     pThCount    = new ThCount(this, pTAppCore-&gt;pMainFrame); }  void QCount::y2() { pVarCount-&gt;SetDataSrc(this, pVarExtVarCount-&gt;GetDataSrc()); }  void QCount::y12() { FInit(); } \/\/ \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a  \u043f\u043e\u0442\u043e\u043a ThCount::ThCount(QCount *p, QObject *parent) :     QThread(parent) {     pQCount = p;     bIfRun = true;      \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\/\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430     start(QThread::IdlePriority);            \/\/ \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a } \/\/ \u0446\u0438\u043a\u043b \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 void ThCount::run() {     bIfStop = false;       \/\/ \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430     pQCount-&gt;pVarWorkingHours-&gt;SetDataSrc(nullptr, &quot;&quot;, nullptr);     pQCount-&gt;pVarCount-&gt;SetDataSrc(pQCount, pQCount-&gt;pVarExtVarCount-&gt;GetDataSrc());     pQCount-&gt;pVarCount-&gt;UpdateVariable();     while(bIfRun)  {         if (pQCount-&gt;pVarCount-&gt;GetDataSrc() &gt; 0) {             bIfExecuteStep = false;             int n = pQCount-&gt;pVarCount-&gt;GetDataSrc();             if (n&gt;0) {                 pQCount-&gt;time.start();             }             pQCount-&gt;time.start();             while (n&gt;0) {                 n--;                 while (bIfExecuteStep) { bIfExecuteStep = false; }             }             string str = QString::number(pQCount-&gt;time.elapsed()).toStdString();             pQCount-&gt;pVarWorkingHours-&gt;SetDataSrc(nullptr, QString::number(pQCount-&gt;time.elapsed()).toStdString(), nullptr);             pQCount-&gt;pVarCount-&gt;SetDataSrc(pQCount, 0.0);             while (n&lt;=0) {                 n = int(pQCount-&gt;pVarCount-&gt;GetDataSrc());             }         }     }     bIfStop = true;        \/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 }  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <i>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0442\u0435\u0441\u0442, \u043e\u0431\u0440\u0430\u0442\u0438\u0432 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/i> \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b, \u0442\u043e, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f Python \u044d\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u043b\u0438\u0448\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 (\u0441\u043c. \u0440\u0438\u0441. 5), \u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0412\u041a\u041f(\u0430) \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 (\u0441\u043c. \u0440\u0438\u0441. 6). \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442-\u0441\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u0438\u0437\u0432\u043d\u0435 \u0435\u0433\u043e, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u0438 \u0432\u0440\u0435\u043c\u044f, \u043e\u0442\u043c\u0435\u0440\u044f\u0435\u043c\u043e\u0435 \u0441\u0430\u043c\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u043c\/\u0442\u0435\u0441\u0442\u0430\u043c\u0438 (\u0441\u043c. \u043b\u0438\u0441\u0442\u0438\u043d\u0433 4). <\/p>\n<p>  <i><b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 2.<\/b> \u00ab\u0421\u0435\u043a\u0443\u043d\u0434\u043e\u043c\u0435\u0440\u00bb \u2014 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u0441\u0447\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u00abs1\u00bb \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u00abst\u00bb <\/i>(\u0441\u043c. \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 \u043d\u0430 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 4). <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ye\/m9\/9j\/yem99jhhwbjomjniiquk588avdq.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.5. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 Python<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gj\/vv\/la\/gjvvlahvngzhh_agxuwgesij9l0.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.6. \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0441\u0440\u0435\u0434\u0435 \u0412\u041a\u041f(\u0430)<\/p>\n<p>  \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0430\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u0438\u043b\u0438 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u2014 \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 (\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e \u0413\u043b\u0443\u0448\u043a\u043e\u0432\u0443 \u0412.\u041c.). <i>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0440\u0435\u0434\u044b \u0412\u041a\u041f(\u0430) \u043d\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/i> \u2014 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0442\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0440\u0435\u0436\u0438\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u0441\u043c. \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 [1]). \u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0441\u043b\u0443\u0436\u0438\u0442 <i>\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 CPU<\/i>.<\/p>\n<p>  \u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0441\u0442\u0430 \u043f\u0440\u0438 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0442\u0430\u043a\u0442\u0435 (\u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u0422\u0410\u0423) \u0438\u043c\u0435\u043d\u0443\u0435\u043c\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c \u043a\u0432\u0430\u043d\u0442\u043e\u0432\u0430\u043d\u0438\u044f) \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e 1 \u043c\u0441\u0435\u043a \u0438 \u0447\u0438\u0441\u043b\u0435 \u0446\u0438\u043a\u043b\u043e\u0432 100000 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c 100 \u0441\u0435\u043a. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0440\u0438\u0441. 7. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bk\/jk\/po\/bkjkpof2u2aemojgtv4at2jpvuq.jpeg\" alt=\"image\"><br \/>   \u0420\u0438\u0441.7. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 (1 \u043c\u0441\u0435\u043a)<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430, \u0442.\u043a., \u0433\u043b\u044f\u0434\u044f \u043d\u0430 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 3, \u043a\u0440\u0438\u0442\u0438\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u043c\u0438\u043d\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e. \u041d\u043e \u043e\u043d\u0438 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u0437\u0430\u0431\u0443\u0434\u0443\u0442 \u043e \u0442\u043e\u043c, \u043e \u0447\u0435\u043c \u043d\u0435 \u0440\u0430\u0437 \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u043e\u0441\u044c. \u041a\u043e\u0434 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0449\u0443\u044e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u043e \u0441\u0440\u0435\u0434\u043e\u0439 \u0412\u041a\u041f(\u0430). \u041a\u0430\u043a\u043e\u0439 \u0432\u0438\u0434 \u043f\u0440\u0438\u043c\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442, \u0435\u0441\u043b\u0438 \u0435\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u043f\u043e\u044f\u0441\u043d\u044f\u0435\u0442 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 7, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 <b>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 7. \u0427\u0438\u0441\u0442\u044b\u0439 \u043a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;lfsaappl.h&quot;  extern LArc TBL_CountMini[]; class FCountMini :     public LFsaAppl { public:     FCountMini(string strNam): LFsaAppl(TBL_CountMini, strNam) {};     int nCount; protected:     int x1();     void y1(); };  #include &quot;stdafx.h&quot; #include &quot;fcountmini.h&quot;  LArc TBL_CountMini[] = {     LArc(&quot;\u04411&quot;,\t&quot;\u04411&quot;,&quot;x1&quot;,\t&quot;y1&quot;),     LArc(&quot;\u04411&quot;,\t&quot;00&quot;,&quot;^x1&quot;,\t&quot;--&quot;),     LArc() }; int FCountMini::x1() { return nCount &gt; 0; } void FCountMini::y1() { --nCount; } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438, \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043f\u0440\u043e\u0449\u0435, \u0445\u043e\u0442\u044f \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0435\u0436\u043d\u0438\u043c. \u041d\u043e, \u043a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0432\u0440\u0435\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0432 \u043f\u043e\u0442\u043e\u043a, \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e (\u0441\u043c. \u043b\u0438\u0441\u0442\u0438\u043d\u0433 4). \u0421 \u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u043c\u0438 (\u0441\u043c. \u0440\u0438\u0441. 8). <\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0421++ \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438 \u0447\u0435\u043c \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jc\/9e\/dd\/jc9eddl6kh2-ycdztw6ukgrgcl4.jpeg\" alt=\"image\"> <br \/>  \u0420\u0438\u0441.8. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f y1 (\u043b\u0438\u0441\u0442\u0438\u043d\u0433 6).<br \/>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u0443\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443\u00bb \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 7. \u0415\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 8. \u041a\u043e\u0434 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439, \u043d\u043e, \u0435\u0449\u0435 \u0440\u0430\u0437, \u0442\u0438\u043f\u043e\u0432\u043e\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u0440\u0435\u0434\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 8. \u041e\u0431\u0435\u0440\u0442\u043a\u0430 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0435 5<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;lfsaappl.h&quot; #include &lt;QTime&gt;  class FCountMini; class FCount :     public LFsaAppl { public:     LFsaAppl* Create(CVarFSA *pCVF) { Q_UNUSED(pCVF)return new FCount(nameFsa); }     bool FCreationOfLinksForVariables();     FCount(string strNam);     virtual ~FCount(void);     CVar *pVarCount;     CVar *pVarExtVarCount{nullptr};     CVar *pVarStrNameExtVarCount;     CVar *pVarWorkingHours; protected:     int x1(); int x12();     void void y3(); void y4(); void y12();     QTime time;     FCountMini *pCountMini{nullptr}; };  #include &quot;stdafx.h&quot; #include &quot;FCount.h&quot; #include &quot;fcountmini.h&quot;  static LArc TBL_Count[] = {     LArc(&quot;st&quot;,\t&quot;s1&quot;,&quot;--&quot;,&quot;y4&quot;),     LArc(&quot;s1&quot;,\t&quot;st&quot;,&quot;--&quot;,&quot;y3&quot;),     LArc() };  FCount::FCount(string strNam):     LFsaAppl(TBL_Count, strNam) { }  FCount::~FCount(void) {     if (pCountMini) delete pCountMini; }  bool FCount::FCreationOfLinksForVariables() {     pVarCount = CreateLocVar(&quot;n&quot;, CLocVar::vtInteger, &quot;local counter&quot;);     pVarStrNameExtVarCount = CreateLocVar(&quot;strNameExtVarCount&quot;, CLocVar::vtString, &quot;external counter name&quot;);;     string str = pVarStrNameExtVarCount-&gt;strGetDataSrc();     if (str != &quot;&quot;) { pVarExtVarCount = pTAppCore-&gt;GetAddressVar(pVarStrNameExtVarCount-&gt;strGetDataSrc().c_str(), this); }     pVarWorkingHours  = CreateLocVar(&quot;strWorkingHours&quot;, CLocVar::vtString, &quot;working hours&quot;);     return true; }  int FCount::x1() { return pVarCount-&gt;GetDataSrc() &gt; 0; }  int FCount::x12() { return pVarExtVarCount != nullptr; }  void FCount::y3() {     pVarWorkingHours-&gt;SetDataSrc(nullptr, QString::number(time.elapsed()).toStdString(), nullptr); }  void FCount::y4() {     time.start();     if (pCountMini) delete pCountMini;         pCountMini = new FCountMini(&quot;CountMini&quot;);      pCountMini-&gt;nCount = pVarExtVarCount-&gt;GetDataSrc();     pCountMini-&gt;FCall(this); }  void FCount::y12() { FInit(); } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0432\u0435\u0441\u0442\u0438 \u0438\u0442\u043e\u0433\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u044b \u0432 \u0412\u041a\u041f(\u0430) \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u043e\u0447\u0442\u0438 \u0432 2600 \u0440\u0430\u0437 \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043d\u0430 Python. \u0422\u0430\u043a\u043e\u0432\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0446\u0435\u043d\u043a\u0430 \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430\u00bb \u0441\u0440\u0435\u0434\u044b \u0412\u041a\u041f(\u0430). \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432 \u044d\u0442\u043e\u043c \u0441\u043e\u043a\u0440\u044b\u0442\u044b \u043a\u043e\u043b\u043e\u0441\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u044b \u0440\u043e\u0441\u0442\u0430, \u0430, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439, \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u0440\u0435\u0434\u044b \u0434\u0430\u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041d\u043e, \u043d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0438 \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043d\u0430 \u044d\u0442\u043e\u0439 \u0431\u0430\u0437\u0435 \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 Phython \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 200 \u0440\u0430\u0437. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u043e\u0442\u043e\u043a\u0430\u043c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u043d\u043e\u0435 \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u00bb \u2014 \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 (\u0430\u043d\u0430\u043b\u043e\u0433 \u00ab\u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043d\u0430 <b>\u0447\u0430\u043d\u043a\u0438<\/b>\u00bb \u0441\u043c. <a href=\"https:\/\/habr.com\/ru\/company\/skyeng\/blog\/453296\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>). \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0421++ \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432 \u0410\u041f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u0435\u0437\u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439, \u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0438\u0441\u0442\u0435\u043c \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438) \u0434\u0430\u0436\u0435 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u0430\u044f. <\/p>\n<p>  <i>\u0418 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/i> \u041c\u0435\u043d\u044f \u0437\u0430\u0446\u0435\u043f\u0438\u043b\u0430 <a href=\"https:\/\/habr.com\/ru\/post\/502134\/\">\u0441\u0442\u0430\u0442\u044c\u044f<\/a>. \u042f \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u00ab\u0445\u0432\u0430\u0442\u0438\u0442 \u0443\u0436\u0435 \u0431\u043e\u044f\u0442\u044c\u0441\u044f \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435\u00bb. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u2014 \u044f \u0437\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c. \u041a\u043e\u0434 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c (\u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c\u043e), \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c (\u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e) \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 (\u0437\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0432 \u0410\u041f \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435 \u043e\u0434\u043d\u043e), \u043d\u043e \u043f\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0441\u0443\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u043a\u0440\u044b\u0442\u0443\u044e \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430 \u043a\u0440\u0430\u0441\u043e\u0442\u0443. \u041f\u0440\u0438\u0447\u0435\u043c \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u0443\u044e.<\/p>\n<p>  \u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438? \u0422\u0435\u043e\u0440\u0438\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0442\u0435\u043e\u0440\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432. \u0415\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043a\u0430\u043a \u0431\u044b \u043e\u043d\u0430 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430, \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0439 \ud83d\ude09 \u0418 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0439, \u0442\u043e \u043a\u0430\u043a \u0431\u044b \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u043d\u043e \u043e\u043d\u0430 \u043d\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430, \u043e\u043d\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u0438. \u0410 \u043f\u043e\u0442\u043e\u043c\u0443 \u0432 \u043a\u0430\u043a\u043e\u043c \u0431\u044b \u0437\u0430\u043f\u0430\u043b\u0435 \u043d\u0438 \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u0438\u0440\u0443\u0439 SWITCH-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e, \u043a\u0430\u043a \u043d\u0438 <a href=\"http:\/\/is.ifmo.ru\/belletristic\/automata\" rel=\"nofollow\">\u0440\u0430\u0441\u0445\u0432\u0430\u043b\u0438\u0432\u0430\u0439 UniMod<\/a>, \u043d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u0442\u0435\u043e\u0440\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432, \u0438\u0441\u043a\u0430\u0436\u0430\u044f \u0435\u0435 \u043a\u0440\u0430\u0441\u043e\u0442\u0443, \u0442\u043e \u043c\u044b \u043f\u043e\u043d\u0435\u0432\u043e\u043b\u0435 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u0447\u0442\u043e \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u043c\u043d\u043e\u0433\u0438\u043c \u043d\u0435 \u0434\u0440\u0443\u0433\u00bb. \u0418 \u043e\u0434\u043d\u0438\u043c\u0438 \u00ab\u043a\u0430\u043c\u043b\u0430\u043d\u0438\u044f\u043c\u0438\u00bb \u0438 \u00ab\u0442\u0430\u043d\u0446\u0430\u043c\u0438 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c\u00bb \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u043d\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0448\u044c. \u041d\u043e, \u0435\u0441\u043b\u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043e\u0440\u0438\u0438, \u044d\u0442\u043e\u0433\u043e \u0438 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u041f\u0443\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u0435\u043b\u044b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432, \u044f, \u043a\u0430\u043a \u0442\u043e\u0442 \u00ab\u0432\u0448\u0438\u0432\u044b\u0439 \u043e \u0431\u0430\u043d\u0435\u00bb, \u043d\u0435 \u043c\u043e\u0433 \u043d\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0430\u0445 \ud83d\ude09 <i>\u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0438\u0445 \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0438 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u043a\u0440\u0430\u0441\u043e\u0442\u0443<\/i>, \u0442.\u043a. \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u00ab\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439\u00bb, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430 \u0440\u0438\u0441. 9 (<a href=\"https:\/\/habr.com\/ru\/post\/493808\/\">\u0441\u043c. \u0442\u0430\u043a\u0436\u0435<\/a>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u044e\u0441\u044c, \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 (?) \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 a = a-b \u0438 b = a+b, \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0445\u043e\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u044b \u0432\u043e\u0441\u0445\u0438\u0449\u0435\u043d\u0438\u044f?<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_1\/lj\/2t\/_1lj2tagueuf7u2itoqbltdrvnu.jpeg\" alt=\"image\"><br \/>  \u0420\u0438\u0441.9. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u0443\u0442\u0438\u043d<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u0430\u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u0435\u043d, \u0430 \u0434\u043b\u044f \u043a\u043e\u0433\u043e-\u0442\u043e \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e \u043a\u0440\u0430\u0441\u0438\u0432, \u043d\u043e \u0440\u0435\u0447\u044c-\u0442\u043e \u043e \u0434\u0440\u0443\u0433\u043e\u043c. \u042f \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e \u043c\u0430\u043d\u0438\u0430\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f. \u0425\u043e\u0442\u044f \u044d\u0442\u043e, \u0435\u0441\u043b\u0438 \u0443\u0436 \u043f\u0440\u044f\u043c\u043e, \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0435\u0442, \u0442.\u043a. <b>\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0435 \u043d\u0443\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c<\/b>. \u042f \u0441\u043e\u0432\u0441\u0435\u043c \u043e \u0434\u0440\u0443\u0433\u043e\u043c. \u0415\u0441\u0442\u044c \u043b\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430\u044f \u043e\u0442 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u0430 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u0442\u044c \u00ab\u0437\u0430\u0433\u043e\u0433\u0443\u043b\u0438\u043d\u044b\u00bb \u044f\u0437\u044b\u043a\u0430 (\u0441\u043c. \u0435\u0449\u0435 \u0440\u0430\u0437 \u0440\u0438\u0441. 9) \u0438 \u0434\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441? \u0412 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u043a\u043e\u0440\u0443\u0442\u0438\u043d \u044f \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u043e\u0440\u0438\u0438 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0445\u043e\u0442\u044f \u0443\u0436\u0435, \u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u043e\u0431\u044b\u0441\u043a\u0430\u043b\u0441\u044f \ud83d\ude09 \u0414\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432 \u2014 \u044d\u0442\u043e \u0442\u0435\u043e\u0440\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c \u0432\u0438\u0434\u0435 (\u0433\u0440\u0430\u0444, \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0438 \u0442.\u043f.) \u0432\u043d\u0435 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044f\u0437\u044b\u043a\u043e\u043c\/\u044f\u0437\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u0435\u0440\u043d\u0443\u0432 \u0437\u0430, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u00ab\u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043d\u0438\u0442\u043e\u0447\u043a\u0443\u00bb, \u043c\u044b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u043b\u0438 \u043a\u043b\u0443\u0431\u043e\u043a\u2026 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c, \u043f\u0440\u0430\u0432\u0434\u0430, \u043b\u0438\u0448\u044c \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0435\u0433\u043e \u0440\u0430\u0441\u043f\u0443\u0448\u0438\u043b\u0438. \u0410 \u043d\u0430\u0447\u0430\u043b\u0438-\u0442\u043e, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0437\u0430\u0431\u044b\u043b, \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e\u0439 CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <\/p>\n<p>  \u041a\u0442\u043e \u0436\u0435 \u043c\u043e\u0433 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0432\u043e \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u044b\u043b\u044c\u0435\u0442\u0441\u044f\u2026 \ud83d\ude42 <\/p>\n<p>  \u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<br \/>  1. \u041c\u0438\u0440\u043e\u0448\u043d\u0438\u043a \u0418.\u0412. \u0422\u0435\u043e\u0440\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u2014 \u0421\u041f\u0431.: \u041f\u0438\u0442\u0435\u0440, 2005. \u2014 336 \u0441.<\/div>\n<p> \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\/post\/506604\/\"> https:\/\/habr.com\/ru\/post\/506604\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/506604\/\">\u041f\u0440\u0438\u0437\u043d\u0430\u044e\u0441\u044c, \u043d\u043e \u044f \u043d\u0435 \u0437\u043d\u0430\u044e Python. \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432\u0437\u044f\u0432\u0448\u0438\u0441\u044c \u0437\u0430 \u0435\u0433\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0443 GIL, \u0432\u044b\u0448\u0435\u043b \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/post\/84629\/\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u00ab\u043d\u0435\u043e\u0431\u044a\u044f\u0441\u043d\u0438\u043c\u044b\u0445 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0432\u043b\u0435\u043d\u0438\u0439\u00bb \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 Python. \u0412\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430 (Finite-state machine \u0438\u043b\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e FSM) \u0432 \u0441\u0440\u0435\u0434\u0435 \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e) \u2014 \u0412\u041a\u041f(\u0430).<\/p>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e <b>\u043b\u044e\u0431\u0430\u044f<\/b> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0440\u0435 CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u0442\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u044b \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443, \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0438\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f Python, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e CPU-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 Python \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430, \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u043e\u0439 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u00ab\u043c\u0438\u0441\u0442\u0438\u043a\u043e\u0439\u00bb. <\/p>\n<p>  \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0435\u0441\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 CPU \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0431\u044b\u0442\u044c (\u0432 \u044d\u0442\u043e\u043c \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f). \u0420\u0435\u0447\u044c \u0438\u0434\u0435\u0442 \u043e \u044f\u0437\u044b\u043a\u0430\u0445, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u043d\u0430 \u043e\u0442 \u0442\u0438\u043f\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c Python, \u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c, \u0438\u043c\u0435\u0435\u0442 \u0434\u0440\u0443\u0433\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0443 \u0435\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <i>\u041a\u0430\u043a\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u043c\u0438\u0441\u0442\u0438\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430\u00bb<\/i>.   <\/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-305303","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305303","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=305303"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305303\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}