{"id":471240,"date":"2025-08-19T15:00:52","date_gmt":"2025-08-19T15:00:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471240"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471240","title":{"rendered":"<span>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 DAG-\u0433\u0440\u0430\u0444\u044b: \u043f\u043e\u0447\u0435\u043c\u0443 TBB \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d \u0438 \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/strong>: \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 TBB \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 workload&#8217;\u043e\u0432, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e 40% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 (\u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438, \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 DAG-\u0433\u0440\u0430\u0444\u044b<\/strong>, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c.<br \/> \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0443\u0436\u0435\u043d \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438\u0431\u043e <code>std::async<\/code>, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 thread-\u043f\u0443\u043b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, oneTBB). \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f <em>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 \u0437\u0430\u0434\u0430\u0447<\/em>, \u0433\u0434\u0435 \u0433\u0440\u0430\u0444 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u0432 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439:<\/p>\n<blockquote>\n<p>\u0433\u0440\u0430\u0444 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 <strong>\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<\/strong> \u0437\u0430\u0440\u0430\u043d\u0435\u0435,<br \/> <strong>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/strong> (\u0438\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0437),<br \/> \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b <strong>\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong>, <strong>affinity<\/strong> \u0438 <strong>\u0436\u0451\u0441\u0442\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438<\/strong>.<\/p>\n<\/blockquote>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043a\u0430\u0434\u0440 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 (\u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u2192 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 DAG), \u043e\u0444\u0444\u043b\u0430\u0439\u043d \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u0433\u0440\u0430\u0444 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<br \/> \u0422\u0430\u043c throughput \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u0435\u043d &#8212; \u0432\u0430\u0436\u043d\u0435\u0435 <em>\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432 \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439<\/em>.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <strong>single-run DAG runtime<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c TBB, \u0430 \u0446\u0435\u043b\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 <em>\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u2192 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u2192 bounded execution<\/em> (\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432).<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 thread-pool \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0422\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043b\u044f single-run<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0417\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043f\u0430\u0432\u043d\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f run()<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u043b\u044c\u0437\u044f \u201c\u0437\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c\u201d \u0433\u0440\u0430\u0444 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c static indegree<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u0440\u0435\u0434\u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0436\u0451\u0441\u0442\u043a\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">backlog \u0440\u0430\u0441\u0442\u0451\u0442 \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0410\u0444\u0444\u0438\u043d\u0438\u0442\u0438 \u2014 best-effort<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0434\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f stage<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0435\u0442 token-based \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0434\u043d\u0430 \u043d\u043e\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0440\u043e\u0434\u0438\u0442\u044c N \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0435\u0441\u0442\u044c \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, heavy stage), producer \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0438 pool \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u201c\u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c\u0441\u044f\u201d. \u041d\u0438 \u043e\u0434\u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0430\u0440\u0435\u043d\u0430 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 consumer\u2019\u044b \u2014 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 enqueue.<\/p>\n<h3>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0433\u0440\u0430\u0444 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e?<\/h3>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 runtime \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <em>\u0436\u0451\u0441\u0442\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e<\/em>:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>, \u0447\u0435\u0440\u0435\u0437 <code>submit \u2192 then \u2192 when_all<\/code><\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <\/strong><code><strong>run()<\/strong><\/code><strong> \u0433\u0440\u0430\u0444 seal\u2019\u0438\u0442\u0441\u044f<\/strong>: <\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 <code>indegree<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u043e\u0434,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f inbox\u2019\u044b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412\u043e\u0440\u043a\u0435\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 <strong>\u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c<\/strong> tokens: <\/p>\n<ul>\n<li>\n<p>work-first (<code>push_bottom<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u2192 <strong>range stealing<\/strong> \u043f\u043e Chase\u2013Lev deque<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0435\u0441\u0442\u044c: <\/p>\n<ul>\n<li>\n<p><code>max_concurrency<\/code><\/p>\n<\/li>\n<li>\n<p><code>capacity<\/code> inbox\u2019\u0430<\/p>\n<\/li>\n<li>\n<p><code>Overflow<\/code> = {<code>Block<\/code>, <code>Drop<\/code>, <code>Fail<\/code>}<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 inbox\u2019\u0430 producer <em>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/em> (\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f), \u0442.\u0435. backpressure \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e runtime, \u0430 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<h3>\u0427\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438(\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 runtime)<\/h3>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/uv\/fh\/zf\/uvfhzfjam2qz9y2jsuphs-hkrn4.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/uv\/fh\/zf\/uvfhzfjam2qz9y2jsuphs-hkrn4.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/uv\/fh\/zf\/uvfhzfjam2qz9y2jsuphs-hkrn4.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u0430\u0447\u0435\u043c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Chase\u2013Lev deque + central MPMC<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">work-first + \u0434\u0435\u0448\u0451\u0432\u043e\u0435 \u0432\u043e\u0440\u043e\u0432\u0441\u0442\u0432\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>ScheduleOptions \/ NodeOptions<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">affinity, priorities, capacity \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Overflow<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Hazard Pointers + QSBR<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>small_function \/ small_vector<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0438\u0437\u0431\u0435\u0433\u0430\u043d\u0438\u0435 heap-alloc\u2019\u043e\u0432 \u0434\u043b\u044f \u043c\u0435\u043b\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>TaskGraph<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 static indegree \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042d\u0442\u043e <em>\u043d\u0435<\/em> \u201c\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 TBB\u201d \u2014 pool \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c runtime (\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u043b\u0451\u0433\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 <code>std::async<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0435\u043d\u0434 \u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432).<\/p>\n<h3>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0443 \u043d\u043e\u0434\u044b \u0435\u0441\u0442\u044c <code>capacity = 4<\/code>, producer \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 5\u0439 token \u2192 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <code>affinity = 2<\/code>, \u0432\u0441\u0435 \u0435\u0451 tokens \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u043e\u0440\u043a\u0435\u0440\u0435 #2<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <code>priority = High<\/code>, token \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 <code>hi<\/code> deque \u2192 \u0432\u044b\u0442\u0435\u0441\u043d\u044f\u0435\u0442 low priority tasks<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e<\/h3>\n<p><strong>\u2714 \u0425\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0440\u0430\u0444\u043e\u0432 (game frame, simulation step, offline pipeline)<\/p>\n<\/li>\n<li>\n<p>real-time \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e <em>bounded latency<\/em><\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 <em>hard affinity \/ priority<\/em>, \u0430 \u043d\u0435 \u201c\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u201d<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u2716 \u041d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e spawn (\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 fork)<\/p>\n<\/li>\n<li>\n<p>long-living \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \/ task \u0430\u0440\u0435\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>general-purpose scheduling<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 API<br \/> \u0424\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f &#171;\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0438, \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438&#187; \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0430 \u0432 API. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0434\u0451\u0440\u0433\u0430\u0442\u044c std::async \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0434\u0430\u0447 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 TaskScope, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 A (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 B, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 A (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 C, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0436\u0434\u0451\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438 A, \u0438 B (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440).<\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">#include &lt;api.hpp&gt;  tp::Pool pool; tp::TaskScope scope(pool);  auto a = scope.submit([] { \/* \u2026 *\/ }); auto b = scope.then(a, [] { \/* \u2026 *\/ }); auto c = scope.when_all({a, b}, [] { \/* \u2026 *\/ });  scope.run_and_wait(); <\/code><\/pre>\n<p>\u0412 TBB \u044d\u0442\u043e \u0431\u044b\u043b \u0431\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 spawn + join, \u043d\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u2014 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0433\u0440\u0430\u0444.<\/p>\n<h3><\/h3>\n<p>Benchmarks (Ryzen 7 6800H, MSVC 19.44) <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Benchmark<\/p>\n<\/th>\n<th>\n<p align=\"left\">Problem size<\/p>\n<\/th>\n<th>\n<p align=\"left\">My runtime<\/p>\n<\/th>\n<th>\n<p align=\"left\">TBB<\/p>\n<\/th>\n<th>\n<p align=\"left\">Speedup (My \/ TBB)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Dependent chain<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00579 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00288 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.01\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Independent tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.52830 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.25051 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.22\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Independent batched<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 (batch=10)<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.41718 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.30121 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.09\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">for_each_ws<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 000 000 elems<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00957 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.0268 s<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>0.36\u00d7<\/strong> (<em>\u22482.8\u00d7 faster<\/em>)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Workflow (w=10, d=5)<\/p>\n<\/td>\n<td>\n<p align=\"left\">~50 stage ops<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00161 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00029 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">5.50\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Noop tasks *<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 000 000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.411 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.2255 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.7\u00d7<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li>\n<p>20-\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u042d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u0447\u0438\u0441\u0442\u044b\u0439 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0442\u043e\u043a\u0435\u043d\u0430. \u0414\u0430, \u0432 \u043c\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u043d \u0432\u044b\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 capacity, indegree \u0438 \u0442.\u0434.). \u0417\u0430\u0442\u043e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0433\u0434\u0435 \u0441\u0430\u043c\u043e &#8216;\u0442\u0435\u043b\u043e&#8217; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u044d\u0442\u043e\u0442 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0430 \u0432\u044b\u0433\u043e\u0434\u044b \u043e\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0412 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u0441 \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f TBB \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0415\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b work-stealing \u0438 \u043e\u0431\u0449\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u044b. \u041c\u043e\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u2014 \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0447\u0438\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0430\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0430\u043a\u043e\u0439 statically-scheduled \u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u043a\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 backpressure \u0432\u0436\u0438\u0432\u0443\u044e.<\/p>\n<p>GitHub: <a href=\"https:\/\/github.com\/cpp20120\/DagFlow\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/cpp20120\/DagFlow<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/938628\/\"> https:\/\/habr.com\/ru\/articles\/938628\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/strong>: \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 TBB \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 workload&#8217;\u043e\u0432, \u043d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e 40% \u0441\u043b\u0443\u0447\u0430\u0435\u0432 (\u0438\u0433\u0440\u043e\u0432\u044b\u0435 \u0434\u0432\u0438\u0436\u043a\u0438, \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <strong>\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 DAG-\u0433\u0440\u0430\u0444\u044b<\/strong>, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c.<br \/> \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0443\u0436\u0435\u043d \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c, \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438\u0431\u043e <code>std::async<\/code>, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 thread-\u043f\u0443\u043b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, oneTBB). \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f <em>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432 \u0437\u0430\u0434\u0430\u0447<\/em>, \u0433\u0434\u0435 \u0433\u0440\u0430\u0444 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430 \u0432 \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041d\u043e \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439:<\/p>\n<blockquote>\n<p>\u0433\u0440\u0430\u0444 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 <strong>\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e<\/strong> \u0437\u0430\u0440\u0430\u043d\u0435\u0435,<br \/> <strong>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/strong> (\u0438\u043b\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0437),<br \/> \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b <strong>\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong>, <strong>affinity<\/strong> \u0438 <strong>\u0436\u0451\u0441\u0442\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438<\/strong>.<\/p>\n<\/blockquote>\n<p>\u0425\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043a\u0430\u0434\u0440 \u0438\u0433\u0440\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 (\u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u2192 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 DAG), \u043e\u0444\u0444\u043b\u0430\u0439\u043d \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438, \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0433\u0434\u0435 \u0433\u0440\u0430\u0444 \u043e\u043f\u0438\u0441\u0430\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<br \/> \u0422\u0430\u043c throughput \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u0435\u043d &#8212; \u0432\u0430\u0436\u043d\u0435\u0435 <em>\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432 \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439<\/em>.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 <strong>single-run DAG runtime<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0438\u043c TBB, \u0430 \u0446\u0435\u043b\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 <em>\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u2192 \u043e\u0434\u0438\u043d \u0432\u044b\u0437\u043e\u0432 \u2192 bounded execution<\/em> (\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0431\u0435\u0437 \u0432\u0441\u043f\u043b\u0435\u0441\u043a\u043e\u0432).<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 thread-pool \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0422\u0438\u043f\u0438\u0447\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043b\u044f single-run<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0417\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u0441\u043f\u0430\u0432\u043d\u0438\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f run()<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043d\u0435\u043b\u044c\u0437\u044f \u201c\u0437\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c\u201d \u0433\u0440\u0430\u0444 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c static indegree<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0447\u0435\u0440\u0435\u0434\u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u0436\u0451\u0441\u0442\u043a\u043e\u0433\u043e \u043b\u0438\u043c\u0438\u0442\u0430<\/p>\n<\/td>\n<td>\n<p align=\"left\">backlog \u0440\u0430\u0441\u0442\u0451\u0442 \u0434\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0410\u0444\u0444\u0438\u043d\u0438\u0442\u0438 \u2014 best-effort<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0434\u0440\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f stage<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0435\u0442 token-based \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u043e\u0434\u043d\u0430 \u043d\u043e\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0440\u043e\u0434\u0438\u0442\u044c N \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u0435\u0441\u0442\u044c \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, heavy stage), producer \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0438 pool \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u201c\u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c\u0441\u044f\u201d. \u041d\u0438 \u043e\u0434\u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0430\u0440\u0435\u043d\u0430 \u043d\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 consumer\u2019\u044b \u2014 \u043e\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 enqueue.<\/p>\n<h3>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0433\u0440\u0430\u0444 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e?<\/h3>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 runtime \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <em>\u0436\u0451\u0441\u0442\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u043f\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e<\/em>:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/strong>, \u0447\u0435\u0440\u0435\u0437 <code>submit \u2192 then \u2192 when_all<\/code><\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <\/strong><code><strong>run()<\/strong><\/code><strong> \u0433\u0440\u0430\u0444 seal\u2019\u0438\u0442\u0441\u044f<\/strong>: <\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432,<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 <code>indegree<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u043e\u0434,<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f inbox\u2019\u044b<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0412\u043e\u0440\u043a\u0435\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 <strong>\u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c<\/strong> tokens: <\/p>\n<ul>\n<li>\n<p>work-first (<code>push_bottom<\/code>)<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u2192 <strong>range stealing<\/strong> \u043f\u043e Chase\u2013Lev deque<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u043e\u0434\u044b \u0435\u0441\u0442\u044c: <\/p>\n<ul>\n<li>\n<p><code>max_concurrency<\/code><\/p>\n<\/li>\n<li>\n<p><code>capacity<\/code> inbox\u2019\u0430<\/p>\n<\/li>\n<li>\n<p><code>Overflow<\/code> = {<code>Block<\/code>, <code>Drop<\/code>, <code>Fail<\/code>}<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 inbox\u2019\u0430 producer <em>\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/em> (\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f), \u0442.\u0435. backpressure \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e runtime, \u0430 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<\/ol>\n<h3>\u0427\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438(\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 runtime)<\/h3>\n<figure class=\"\"><\/figure>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0417\u0430\u0447\u0435\u043c<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Chase\u2013Lev deque + central MPMC<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">work-first + \u0434\u0435\u0448\u0451\u0432\u043e\u0435 \u0432\u043e\u0440\u043e\u0432\u0441\u0442\u0432\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>ScheduleOptions \/ NodeOptions<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">affinity, priorities, capacity \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Overflow<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Hazard Pointers + QSBR<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>small_function \/ small_vector<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0438\u0437\u0431\u0435\u0433\u0430\u043d\u0438\u0435 heap-alloc\u2019\u043e\u0432 \u0434\u043b\u044f \u043c\u0435\u043b\u043a\u0438\u0445 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>TaskGraph<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 static indegree \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u042d\u0442\u043e <em>\u043d\u0435<\/em> \u201c\u043e\u0431\u0451\u0440\u0442\u043a\u0430 \u0432\u043e\u043a\u0440\u0443\u0433 TBB\u201d \u2014 pool \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c runtime (\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u043a\u0430\u043a \u043b\u0451\u0433\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 <code>std::async<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0430\u0440\u0435\u043d\u0434 \u0438 \u0430\u043b\u043b\u043e\u043a\u0430\u0442\u043e\u0440\u043e\u0432).<\/p>\n<h3>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435<\/h3>\n<ul>\n<li>\n<p>\u0435\u0441\u043b\u0438 \u0443 \u043d\u043e\u0434\u044b \u0435\u0441\u0442\u044c <code>capacity = 4<\/code>, producer \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 5\u0439 token \u2192 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <code>affinity = 2<\/code>, \u0432\u0441\u0435 \u0435\u0451 tokens \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u0432\u043e\u0440\u043a\u0435\u0440\u0435 #2<\/p>\n<\/li>\n<li>\n<p>\u0435\u0441\u043b\u0438 <code>priority = High<\/code>, token \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 <code>hi<\/code> deque \u2192 \u0432\u044b\u0442\u0435\u0441\u043d\u044f\u0435\u0442 low priority tasks<\/p>\n<\/li>\n<\/ul>\n<h3>\u041a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e<\/h3>\n<p><strong>\u2714 \u0425\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0440\u0430\u0444\u043e\u0432 (game frame, simulation step, offline pipeline)<\/p>\n<\/li>\n<li>\n<p>real-time \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e <em>bounded latency<\/em><\/p>\n<\/li>\n<li>\n<p>\u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 <em>hard affinity \/ priority<\/em>, \u0430 \u043d\u0435 \u201c\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u201d<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u2716 \u041d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f:<\/strong><\/p>\n<ul>\n<li>\n<p>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e spawn (\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 fork)<\/p>\n<\/li>\n<li>\n<p>long-living \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \/ task \u0430\u0440\u0435\u043d\u044b<\/p>\n<\/li>\n<li>\n<p>general-purpose scheduling<\/p>\n<\/li>\n<\/ul>\n<hr\/>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435: \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 API<br \/> \u0424\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f &#171;\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0438, \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438&#187; \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0430 \u0432 API. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0434\u0451\u0440\u0433\u0430\u0442\u044c std::async \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u043c\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0435\u0441\u044c \u0433\u0440\u0430\u0444 \u0437\u0430\u0434\u0430\u0447 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 TaskScope, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 A (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 B, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 A (\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438).<\/p>\n<p>\u0415\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 C, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0436\u0434\u0451\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438 A, \u0438 B (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043d\u0430 \u0440\u0435\u043d\u0434\u0435\u0440).<\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">#include &lt;api.hpp&gt;  tp::Pool pool; tp::TaskScope scope(pool);  auto a = scope.submit([] { \/* \u2026 *\/ }); auto b = scope.then(a, [] { \/* \u2026 *\/ }); auto c = scope.when_all({a, b}, [] { \/* \u2026 *\/ });  scope.run_and_wait(); <\/code><\/pre>\n<p>\u0412 TBB \u044d\u0442\u043e \u0431\u044b\u043b \u0431\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 spawn + join, \u043d\u043e \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u2014 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0433\u0440\u0430\u0444.<\/p>\n<h3><\/h3>\n<p>Benchmarks (Ryzen 7 6800H, MSVC 19.44) <\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Benchmark<\/p>\n<\/th>\n<th>\n<p align=\"left\">Problem size<\/p>\n<\/th>\n<th>\n<p align=\"left\">My runtime<\/p>\n<\/th>\n<th>\n<p align=\"left\">TBB<\/p>\n<\/th>\n<th>\n<p align=\"left\">Speedup (My \/ TBB)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Dependent chain<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00579 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00288 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">2.01\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Independent tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.52830 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.25051 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.22\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Independent batched<\/p>\n<\/td>\n<td>\n<p align=\"left\">1000 (batch=10)<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.41718 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.30121 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">1.09\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">for_each_ws<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 000 000 elems<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00957 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.0268 s<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>0.36\u00d7<\/strong> (<em>\u22482.8\u00d7 faster<\/em>)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Workflow (w=10, d=5)<\/p>\n<\/td>\n<td>\n<p align=\"left\">~50 stage ops<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00161 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.00029 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">5.50\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Noop tasks *<\/p>\n<\/td>\n<td>\n<p align=\"left\">1 000 000 tasks<\/p>\n<\/td>\n<td>\n<p align=\"left\">4.411 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">0.2255 s<\/p>\n<\/td>\n<td>\n<p align=\"left\">20.7\u00d7<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ul>\n<li>\n<p>20-\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0435 \u043f\u0443\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u2014 \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u042d\u0442\u043e\u0442 \u0442\u0435\u0441\u0442 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442 \u0447\u0438\u0441\u0442\u044b\u0439 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u0442\u043e\u043a\u0435\u043d\u0430. \u0414\u0430, \u0432 \u043c\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u043d \u0432\u044b\u0448\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 capacity, indegree \u0438 \u0442.\u0434.). \u0417\u0430\u0442\u043e \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0433\u0434\u0435 \u0441\u0430\u043c\u043e &#8216;\u0442\u0435\u043b\u043e&#8217; \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u044d\u0442\u043e\u0442 \u043e\u0432\u0435\u0440\u0445\u0435\u0434 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0430 \u0432\u044b\u0433\u043e\u0434\u044b \u043e\u0442 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0412 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445 \u0441 \u0434\u043b\u0438\u043d\u043d\u044b\u043c\u0438 \u0446\u0435\u043f\u043e\u0447\u043a\u0430\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f TBB \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0415\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b work-stealing \u0438 \u043e\u0431\u0449\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0444\u044b. \u041c\u043e\u0439 \u0440\u0430\u043d\u0442\u0430\u0439\u043c \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u2014 \u0432 \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u0441\u0442\u0438 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0447\u0438\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0433\u0440\u0430\u0444\u0430\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0442\u0430\u043a\u043e\u0439 statically-scheduled \u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u043a\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0442, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438, \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 backpressure \u0432\u0436\u0438\u0432\u0443\u044e.<\/p>\n<p>GitHub: <a href=\"https:\/\/github.com\/cpp20120\/DagFlow\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/cpp20120\/DagFlow<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/938628\/\"> https:\/\/habr.com\/ru\/articles\/938628\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-471240","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471240","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=471240"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471240\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}