{"id":90050,"date":"2020-07-28T13:42:44","date_gmt":"2020-07-28T11:42:44","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn"},"modified":"2020-07-28T13:42:44","modified_gmt":"2020-07-28T11:42:44","slug":"google-nachal-otkrytie-realizaczii-modeli-potokov-mn","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/news\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn","title":{"rendered":"Google has begun the implementation of the M:N threading model.","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Google Inc. <noindex><a rel=\"nofollow\" href=\"https:\/\/lore.kernel.org\/lkml\/20200722234538.166697-1-posk@posk.io\/\">offered<\/a><\/noindex> the first set of patches to be included in the Linux kernel, implementing the components necessary for the functioning of the M:N threading model. Google's initiative is related to the unveiling of a previously closed API. <noindex><a rel=\"nofollow\" href=\"http:\/\/pdxplumbers.osuosl.org\/2013\/ocw\/\/system\/presentations\/1653\/original\/LPC%20-%20User%20Threading.pdf\">SwitchTo<\/a><\/noindex> for the Linux kernel, enabling the operation of a user-space multithreading subsystem that uses the M:N threading model. This subsystem is used by Google to support services that require minimal latency. Thread scheduling and management of thread distribution are done entirely in user space, significantly reducing the number of context-switching operations by minimizing system calls.<\/p>\n<p>To ensure the operation of the specified subsystem at the Linux kernel level, the SwitchTo API was implemented, offering three basic operations \u2014 wait, resume, and swap (switching). To be integrated into the kernel, a new operation code FUTEX_SWAP has been proposed, complementing <noindex><a rel=\"nofollow\" href=\"https:\/\/man7.org\/linux\/man-pages\/man2\/futex.2.html\">FUTEX_WAIT and FUTEX_WAKE<\/a><\/noindex>, and providing a basis for creating multithreading libraries in user space. FUTEX_SWAP can also be used for message passing between tasks, similar to RPC. For example, currently, passing a message between tasks requires at least four calls to FUTEX_WAIT and FUTEX_WAKE, whereas using FUTEX_SWAP will allow this with a single operation, performed 5-10 times faster.<\/p>\n<p><center><noindex><a rel=\"nofollow\" href=\"http:\/\/pdxplumbers.osuosl.org\/2013\/ocw\/\/system\/presentations\/1653\/original\/LPC%20-%20User%20Threading.pdf\"><img decoding=\"async\" alt=\"Google has begun the implementation of the M:N threading model.\" src=\"\/wp-content\/uploads\/2020\/07\/a8a6049cd1d1aafd2a8caf08afcf3d6d.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/center><\/p>\n<p>Currently, the 1:1 and N:1 threading models are primarily used in practice. The 1:1 model is used in <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Native_POSIX_Thread_Library\">NPTL<\/a><\/noindex> (POSIX threads) and <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/LinuxThreads\">LinuxThreads<\/a><\/noindex>, and implies a direct mapping of a user-space thread to a scheduling unit in the kernel. The N:1 model is implemented in <noindex><a rel=\"nofollow\" href=\"https:\/\/www.gnu.org\/software\/pth\/\">GNU Pth<\/a><\/noindex>, which moves thread dispatching to user space and allows N user-space threads to be bound to one thread in the kernel, with the kernel having no information about user threads.<\/p>\n<p>The main drawback of the 1:1 model is the high overhead of context switching between the kernel and user space. The N:1 model addresses this issue, but it creates a new one \u2014 since a thread in the kernel is an indivisible unit of execution scheduling, user threads bound to a single thread in the operating system kernel cannot scale across CPU cores and end up being tied to a single CPU core.<\/p>\n<p>The M:N model is hybrid and eliminates all the aforementioned drawbacks by mapping N user space threads to M kernel threads, which reduces context switching overhead and allows scaling across CPU cores. The trade-off for this option is a significant increase in the complexity of implementing the thread scheduler in user space and the need for synchronization mechanisms with the kernel scheduler.<\/p>\n<p><center><div class=\"youtube-placeholder\" data-id=\"KXuZi9aeGTw\" onclick=\"loadVideo(this)\">\r\n        <img decoding=\"async\" src=\"https:\/\/img.youtube.com\/vi\/KXuZi9aeGTw\/hqdefault.jpg\" alt=\"Play video\" loading=\"lazy\" width=\"480\" height=\"360\" style=\"width:100%;height:auto;\">\r\n        <div class=\"play-button\"><\/div>\r\n    <\/div><\/center><\/p>\n<p><noindex><a rel=\"nofollow\" name=\"link\"><\/a><\/noindex><\/p>\n<p>Source: <a \ncontent=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=53443\">opennet.ru<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0430 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u044f\u0434\u0440\u0430 Linux \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0447\u0435\u0439 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 M:N. \u0418\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u0430 Google \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0437\u0430 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0434\u0432\u0435\u0440\u044f\u043c\u0438 API SwitchTo \u0434\u043b\u044f \u044f\u0434\u0440\u0430 Linux, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u0432 M:N. \u041f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 Google \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":90051,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-90050","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0430 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u044f\u0434\u0440\u0430 Linux \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0447\u0435\u0439 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/news\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47Google \u043d\u0430\u0447\u0430\u043b \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 M:N | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0430 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u044f\u0434\u0440\u0430 Linux \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0447\u0435\u0439 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/news\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-07-28T11:42:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-28T11:42:44+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Google has started rolling out the implementation of the M:N thread model | ProHoster","description":"Google has proposed the first set of patches for inclusion in the Linux kernel implementation.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/news\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47Google \u043d\u0430\u0447\u0430\u043b \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 M:N | ProHoster","og:description":"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Google \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b\u0430 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u044f\u0434\u0440\u0430 Linux \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0447\u0435\u0439 \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439.","og:url":"https:\/\/prohoster.info\/en\/blog\/news\/google-nachal-otkrytie-realizaczii-modeli-potokov-mn","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-07-28T11:42:44+00:00","article:modified_time":"2020-07-28T11:42:44+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"90050","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 12:59:44","updated":"2022-10-01 00:41:43","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/90050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=90050"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/90050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/90051"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=90050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=90050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=90050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}