{"id":17667,"date":"2018-06-08T14:50:02","date_gmt":"2018-06-08T14:50:02","guid":{"rendered":"https:\/\/gb.ru\/blog\/?p=17667"},"modified":"2023-12-06T15:55:08","modified_gmt":"2023-12-06T15:55:08","slug":"python-multithreading-pt2","status":"publish","type":"post","link":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/","title":{"rendered":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438"},"content":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<div class=\"topic-list\">\n<p><b>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f:<\/b><\/p>\n<ol class=\"main-list\">\n<li><a href=\"#1\">\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 Python<\/a><\/li>\n<li><a href=\"#2\">\u0421 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0431\u0435\u0437. \u041f\u0440\u0438\u043c\u0435\u0440\u2013\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"#3\">\u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a?<\/a><\/li>\n<li><a href=\"#4\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Python<\/a><\/li>\n<li><a href=\"#5\">\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 with<\/a><\/li>\n<li><!-- noindex -->\r\n<style>\r\n    .checklist-download {\r\n        align-items: flex-start;\r\n        cursor: pointer;\r\n        display: flex;\r\n        flex-direction: row;\r\n        justify-content: flex-start;\r\n        margin-left: 20px;\r\n    }\r\n    .checklist-download__icon {\r\n        height: 44px;\r\n        margin-right: 10px;\r\n        width: 34px;\r\n    }\r\n    .checklist-download__content {\r\n        align-items: flex-start;\r\n        display: flex;\r\n        flex-direction: column;\r\n        font-family: 'IBM Plex Sans', sans-serif;\r\n        justify-content: flex-start;\r\n    }\r\n    .checklist-download__content-title {\r\n        color: #0968ad;\r\n        font-style: normal;\r\n        font-weight: 700;\r\n        font-size: 20px;\r\n        line-height: 24px;\r\n        margin-bottom: 5px;\r\n        text-decoration: underline;\r\n        animation: text-pulse 2s ease-in-out infinite;\r\n    }\r\n    @keyframes text-pulse {\r\n      from {\r\n        transform: scale(.99);\r\n      }\r\n      50% {\r\n        transform: scale(1);\r\n      }\r\n      to {\r\n        transform: scale(.99);\r\n      }\r\n    }\r\n    .checklist-download__content-title:hover {\r\n      color: #6654D9;\r\n    }\r\n    .checklist-download__content-desc {\r\n        font-style: italic;\r\n        font-weight: 400;\r\n        font-size: 16px;\r\n        line-height: 22px;\r\n        color: #636363;\r\n    }\r\n    @media screen and (max-width: 768px) {\r\n        .checklist-download__content {\r\n            margin-left: 10px;\r\n        }\r\n        .checklist-download__content-title {\r\n            font-size: 16px;\r\n            line-height: 21px;\r\n        }\r\n        .checklist-download__content-desc {\r\n            font-size: 14px;\r\n            line-height: 18px;\r\n        }\r\n    }\r\n<\/style>\r\n\r\n<div class=\"checklist-download\">\r\n    <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" class=\"checklist-download__icon\" width=\"34px\" height=\"44px\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/checklist-download\/checklist-download-icon.svg\" alt=\"\"><meta itemprop=\"width\" content=\"34px\"><meta itemprop=\"height\" content=\"44px\"><\/span>\r\n    <div class=\"checklist-download__content\">\r\n        <div class=\"checklist-download__content-title\">\u041f\u0440\u043e\u0439\u0434\u0438 \u0442\u0435\u0441\u0442 \u0438 \u0443\u0437\u043d\u0430\u0439, \u043a\u0430\u043a\u0430\u044f \u0441\u0444\u0435\u0440\u0430 \u0442\u0435\u0431\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442:<br> \u0430\u0439\u0442\u0438, \u0434\u0438\u0437\u0430\u0439\u043d \u0438\u043b\u0438 \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433.<\/div>\r\n        <div class=\"checklist-download__content-desc\">\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043e\u0442 Geekbrains<\/div>\r\n    <\/div>\r\n<\/div>\r\n<!-- \/noindex -->\r\n<\/li>\n<\/ol>\n<\/div>\n<p>\u041f\u043e\u0442\u043e\u043a\u0438 \u0441\u0442\u0440\u0435\u043c\u044f\u0442\u0441\u044f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0418 \u043a\u043e\u0433\u0434\u0430 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442. \u041a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c?<\/p>\n<p>\u041f\u043e\u0442\u043e\u043a\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c: \u043d\u0430 \u0442\u043e \u043e\u043d\u0438 \u0438 \u043f\u043e\u0442\u043e\u043a\u0438. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0438\u0445 \u043f\u0443\u0442\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043c\u0431\u0443 \u2014 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443. \u041e\u043d\u0430 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0443\u0434\u0435\u0440\u0436\u0438\u0442. \u0422\u0430\u043a \u0432\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442.<\/p>\n\r\n<!-- noindex -->\r\n<div class=\"career career-23 career-23-v2\">\r\n\r\n    <div class=\"career-header\">\r\n\r\n        <div class=\"career-header__item career-header__item-descr\">\r\n            <div class=\"career-header__title\">\r\n                \u0423\u0437\u043d\u0430\u0439, \u043a\u0430\u043a\u0438\u0435 \u0418\u0422&nbsp;-&nbsp;\u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438<br> \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0422\u041e\u041f-30 <span>\u0441 \u0434\u043e\u0445\u043e\u0434\u043e\u043c<br> \u043e\u0442 210&nbsp;000 \u20bd\/\u043c\u0435\u0441<\/span>\r\n            <\/div>\r\n\r\n            <div class=\"career-header__item career-header__item-about mob\">\r\n                <div class=\"career-header__img\">\r\n                    <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"114\" height=\"138\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-top-it-30-2023-v2\/Pavel_Simonov-m.png\" alt=\"\u041f\u0430\u0432\u0435\u043b \u0421\u0438\u043c\u043e\u043d\u043e\u0432 - \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 Geekbrains\" loading=\"lazy\"><meta itemprop=\"width\" content=\"114\"><meta itemprop=\"height\" content=\"138\"><\/span>\r\n                <\/div>\r\n\r\n                <div class=\"career-header__man\">\r\n                    <div>\u041f\u0430\u0432\u0435\u043b \u0421\u0438\u043c\u043e\u043d\u043e\u0432<\/div>\r\n                    <span>\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 Geekbrains<\/span>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"text\">\r\n                \u041a\u043e\u043c\u0430\u043d\u0434\u0430 GeekBrains \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u043c\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c\u0438 \u043f\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044e \u043a\u0430\u0440\u044c\u0435\u0440\u044b\r\n                \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u043c\u0435\u0447\u0442\u044b.\r\n            <\/div>\r\n\r\n            <div class=\"text\">\r\n                \u041f\u043e\u0434\u0431\u043e\u0440\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u044b\u0435 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\r\n                IT-\u0441\u0444\u0435\u0440\u0435. 86% \u043d\u0430\u0448\u0438\u0445 \u0443\u0447\u0435\u043d\u0438\u043a\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u0441 \u043a\u0430\u0440\u044c\u0435\u0440\u043d\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u043d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435\r\n                \u0431\u0443\u0434\u0443\u0449\u0435\u0435!\r\n            <\/div>\r\n\r\n            <p class=\"career-list\">\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0439\u0442\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0443\u0436\u0435 \u0441\u0435\u0433\u043e\u0434\u043d\u044f:<\/p>\r\n        <\/div>\r\n\r\n        <div class=\"career-header__item career-header__item-about pc\">\r\n            <div class=\"career-header__img\">\r\n                <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"276\" height=\"409\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-top-it-30-2023-v2\/Pavel_Simonov.png\" alt=\"\u041f\u0430\u0432\u0435\u043b \u0421\u0438\u043c\u043e\u043d\u043e\u0432 - \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 Geekbrains\" loading=\"lazy\"><meta itemprop=\"width\" content=\"276\"><meta itemprop=\"height\" content=\"409\"><\/span>\r\n            <\/div>\r\n\r\n            <div class=\"career-header__man\">\r\n                <div>\u041f\u0430\u0432\u0435\u043b \u0421\u0438\u043c\u043e\u043d\u043e\u0432<\/div>\r\n                <span>\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440 Geekbrains<\/span>\r\n            <\/div>\r\n        <\/div>\r\n\r\n    <\/div>\r\n\r\n    <div class=\"career-body\">\r\n\r\n        <div class=\"prof-pdf-list\">\r\n\r\n            <div class=\"career-pdf-list__item\" id=\"careerPdfListItem1\">\r\n                <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"50\" height=\"50\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/pdf-insert-prof.svg\" alt=\"pdf \u0438\u043a\u043e\u043d\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"50\"><meta itemprop=\"height\" content=\"50\"><\/span>\r\n                <div>\r\n                    <p class=\"career-pdf-list__item-virtual-title\">\u0422\u043e\u043f-30 \u0441\u0430\u043c\u044b\u0445 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439 2023<\/p>\r\n                    <p class=\"career-pdf-list__item-virtual-description\">\u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0442\u0440\u0443\u0434\u0430<\/p>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"career-pdf-list__item\" id=\"careerPdfListItem2\">\r\n                <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"50\" height=\"50\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/docx-insert-v2.png\" alt=\"doc \u0438\u043a\u043e\u043d\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"50\"><meta itemprop=\"height\" content=\"50\"><\/span>\r\n                <div>\r\n                    <p class=\"career-pdf-list__item-virtual-title\">\u041f\u043e\u0434\u0431\u043e\u0440\u043a\u0430 50+ \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/p>\r\n                    <p class=\"career-pdf-list__item-virtual-description\">\u0422\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0438\u0437 \u0420\u043e\u0441\u0441\u0438\u0438 \u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"career-pdf-list__item\" id=\"careerPdfListItem3\">\r\n                <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"50\" height=\"50\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/pdf-insert-prof.svg\" alt=\"pdf \u0438\u043a\u043e\u043d\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"50\"><meta itemprop=\"height\" content=\"50\"><\/span>\r\n                <div>\r\n                    <p class=\"career-pdf-list__item-virtual-title\">\u0422\u041e\u041f-100 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442 GeekBrains<\/p>\r\n                    <p class=\"career-pdf-list__item-virtual-description\">\u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0439 \u0441 \u0434\u043e\u0445\u043e\u0434\u043e\u043c \u043e\u0442 210 000 \u20bd<\/p>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <button class=\"get-gifts-btn\" id=\"getGifts\">\r\n            \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\r\n            <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" class=\"pc\" width=\"39\" height=\"39\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/hand_anime.gif\" alt=\"\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043a\u043b\u0438\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"39\"><meta itemprop=\"height\" content=\"39\"><\/span>\r\n            <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" class=\"mob\" width=\"20\" height=\"27\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/hand_anime.gif\" alt=\"\u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u043a\u043b\u0438\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"20\"><meta itemprop=\"height\" content=\"27\"><\/span>\r\n        <\/button>\r\n\r\n        <div class=\"career-body__file-wrapper\">\r\n            <div class=\"career-body__file\">pdf 3,7mb<\/div>\r\n            <div class=\"career-body__file\">doc 1,7mb<\/div>\r\n        <\/div>\r\n\r\n        <div class=\"profession-download\">\r\n            \u0423\u0436\u0435 \u0441\u043a\u0430\u0447\u0430\u043b\u0438  35942            <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" decoding=\"async\" width=\"19\" height=\"18\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-top-it-30-2023\/vrezka-submit-people.svg\" alt=\"pdf \u0438\u043a\u043e\u043d\u043a\u0430\" loading=\"lazy\"><meta itemprop=\"width\" content=\"19\"><meta itemprop=\"height\" content=\"18\"><\/span>\r\n        <\/div>\r\n\r\n    <\/div>\r\n\r\n<\/div>\r\n<!-- \/noindex -->\r\n\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0442\u043e\u043a A \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u0430 \u043f\u043e\u0442\u043e\u043a \u0411 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043c\u0435\u0448\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0435\u0435 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u2014 \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u0430. \u0417\u0430\u043b\u043e\u0433\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u2014 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0434\u0435\u043b\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h2 id=\"1\">\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 Python<\/h2>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 (mutual exception, \u043a\u0440\u0430\u0442\u043a\u043e \u2014 mutex) \u2014 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0442\u043e\u043a\u0430 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 Lock.<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #0c450d; font-weight: bold;\">import<\/span> threading\r\nmutex <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Lock()\r\n<\/pre>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c mutex, \u043d\u043e \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0451 lock \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438 \u0441\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 .acquire() \u0438 .release():<\/p>\n<pre style=\"background: #fff; color: #000;\">resource <span style=\"color: #00f; font-weight: bold;\">=<\/span> <span style=\"color: #0000cd;\">0<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">thread_safe_function<\/span>():\r\n<span style=\"color: #00f; font-weight: bold;\">global<\/span> resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(<span style=\"color: #0000cd;\">1000000<\/span>):\r\n        mutex.acquire()\r\n        <span style=\"color: #06f; font-style: italic;\"># \u0414\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u0442\u043e \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 resource<\/span>\r\n        mutex.release()\r\n<\/pre>\n<div class=\"blue-bg-border-block border\">\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u043e\u0431\u043e\u0439\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u043f\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0451 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043b. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d, \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442.<\/p>\n<\/div>\n<h2 id=\"2\">\u0421 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0431\u0435\u0437. \u041f\u0440\u0438\u043c\u0435\u0440\u2013\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0431\u044c\u044e\u0442\u0441\u044f \u0437\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0438 \u043a\u0430\u043a \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445? \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<\/p>\n<style>\r\n    .banner-2__wrap {\r\n        background: url(\"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2023\/05\/bg-programmer.png\") no-repeat center;\r\n        background-size: cover;\r\n    }\r\n\r\n    @media (max-width: 800px) {\r\n        .banner-2__wrap {\r\n            background: url(\"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2023\/05\/bg-programmer-mob.png\") no-repeat center;\r\n            background-size: cover;\r\n        }\r\n    }\r\n<\/style>\r\n<!-- noindex -->\r\n<div class=\"banner-2__wrap get-course\">\r\n\r\n    <div class=\"banner-2\">\r\n\r\n        <div class=\"banner-2__content\">\r\n\r\n            <div class=\"banner-2__notice\">\r\n                \u0414\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0430\u0440\u043e\u043a! \u0412&nbsp;\u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u043c&nbsp;\u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0434\u043e <span\r\n                    style=\"color: #a055ff\">\r\n                    19.04<\/span>\r\n                <!-- \u0414\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0430\u0440\u043e\u043a! \u0412 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0434\u043e<span><\/span> -->\r\n            <\/div>\r\n\r\n            \r\n                <div class=\"banner-2__title\">\r\n                    <span style=\"color: #a055ff\">\r\n                    \u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0422\u041e\u041f-10 <br>\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439<\/span>\r\n                    <br>\u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f                <\/div>\r\n\r\n            \r\n            \r\n                <div class=\"banner-2__description\">\u041f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 25%<\/div>\r\n\r\n                    <\/div>\r\n\r\n        <form class=\"banner-2__input-wrap\">\r\n\r\n            <div class=\"banner-2__input-form-wrap\">\r\n                <label for=\"email\">\r\n                    <span>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b, \u0443\u043a\u0430\u0436\u0438\u0442\u0435 e-mail:<\/span>\r\n                    <input type=\"email\" name=\"email\" id=\"bannerTwoEmail\" placeholder=\"E-mail, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, info@gb.ru\" required\r\n                           pattern=\"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$\">\r\n                <\/label>\r\n\r\n                <label class=\"input-tel-wrap\" for=\"tel\" style=\"position: relative\">\r\n                    <span>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0440\u043e\u0431\u043e\u0442, \u0443\u043a\u0430\u0437\u0430\u0432 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430:<\/span>\r\n                    <input type=\"tel\" id=\"bannerTwoTel\" class=\"only_num\" name=\"tel\" required>\r\n                <\/label>\r\n\r\n                <div class=\"submit\">\r\n\r\n                    <div class=\"banner-2__group-submit\">\r\n\r\n                        <!--                    <div class=\"banner-2__img-wrapper\">-->\r\n                        <!--                        <span itemprop=\"image\" itemscope itemtype=\"https:\/\/schema.org\/ImageObject\"><img itemprop=\"url image\" loading=\"lazy\" decoding=\"async\" class=\"banner-2__img-people\" width=\"18\" height=\"13\" src=\"--><meta itemprop=\"width\" content=\"18\"><meta itemprop=\"height\" content=\"13\"><\/span>\r\n                        <!--\/assets\/images\/banner-two-get-course\/people.png\" alt=\"\u0418\u043a\u043e\u043d\u043a\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0439\" loading=\"lazy\">-->\r\n                        <!--                        \u0423\u0436\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u043e\u043f\u0440\u043e\u0441 8965 \u0447\u0435\u043b\u043e\u0432\u0435\u043a-->\r\n                        <!--                    <\/div>-->\r\n\r\n                        <button type=\"submit\" class=\"banner-2__submit\">\r\n                            \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\r\n                        <\/button>\r\n\r\n                    <\/div>\r\n                <\/div>\r\n            <\/div>\r\n\r\n            <div class=\"control control--checkbox\">\r\n                <input type=\"checkbox\" checked=\"checked\" id=\"banner_2__wrap_get_course\" class=\"checked-suc\"\/>\r\n                <label class=\"control-checkbox__text\" for=\"banner_2__wrap_get_course\">\r\n                    \u042f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 <a href=\"https:\/\/gb.ru\/confidential\/\">\u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>\r\n                <\/label>\r\n                <div class=\"control__indicator\"><\/div>\r\n            <\/div>\r\n\r\n\r\n        <\/form>\r\n    <\/div>\r\n<\/div>\r\n\r\n<div class=\"popup banner-2__suc-wrap\">\r\n    <div class=\"banner-2__popup-success\">\r\n        <div class=\"popup-close banner-2__suc-close\">\r\n            <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"times\" role=\"img\"\r\n                 xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 320 512\" class=\"svg-inline--fa fa-times fa-w-10 fa-3x\">\r\n                <path fill=\"#00000\"\r\n                      d=\"M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z\"\r\n                      class=\"\"><\/path>\r\n            <\/svg>\r\n        <\/div>\r\n        <div class=\"banner-2__suc-title\">\r\n            \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0430\u0440\u043e\u043a, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435\r\n        <\/div>\r\n        <div class=\"banner-2__suc-actions\">\r\n            <a id=\"bannerTarget\" href=\"https:\/\/gb.ru\/a\/a_blog1\" target=\"_blank\">\u041f\u0435\u0440\u0435\u0439\u0442\u0438<\/a>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<a class=\"banner-2__download_file\" href=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/job_search_channels_in_a_crisis.pdf\" download>\u0421\u043a\u0430\u0447\u0430\u0442\u044c\r\n    \u0444\u0430\u0439\u043b<\/a>\r\n<!-- \/noindex -->\r\n\n<p>\u0412\u043e\u0437\u044c\u043c\u0451\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430 (\u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430). \u0412 \u0440\u043e\u043b\u0438 \u043e\u0431\u0449\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432\u044b\u0441\u0442\u0443\u043f\u044f\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435: \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0438\u0445 protected_resource \u0438 unprotected_resource. \u041a \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u0440\u0430\u0442\u044f\u0442\u0441\u044f \u043f\u043e \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430: \u043e\u0434\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 0 \u0434\u043e 50 000, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u0434\u043e 0. \u041f\u0435\u0440\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438, \u0430 \u0432\u0442\u043e\u0440\u0443\u044e \u2014 \u0431\u0435\u0437.<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #0c450d; font-weight: bold;\">import<\/span> threading\r\nprotected_resource <span style=\"color: #00f; font-weight: bold;\">=<\/span> <span style=\"color: #0000cd;\">0<\/span>\r\nunprotected_resource <span style=\"color: #00f; font-weight: bold;\">=<\/span> <span style=\"color: #0000cd;\">0<\/span>\r\nNUM <span style=\"color: #00f; font-weight: bold;\">=<\/span> <span style=\"color: #0000cd;\">50000<\/span>\r\nmutex <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Lock()\r\n<span style=\"color: #06f; font-style: italic;\"># \u041f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">safe_plus<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> protected_resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(NUM):\r\n        <span style=\"color: #06f; font-style: italic;\"># \u0421\u0442\u0430\u0432\u0438\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443<\/span>\r\n        mutex.acquire()\r\n        protected_resource <span style=\"color: #00f; font-weight: bold;\">+=<\/span> <span style=\"color: #0000cd;\">1<\/span>\r\n        mutex.release()\r\n<span style=\"color: #06f; font-style: italic;\"># \u041f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0434\u0435\u043a\u0440\u0435\u043c\u0435\u043d\u0442<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">safe_minus<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> protected_resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(NUM):\r\n        mutex.acquire()\r\n        protected_resource <span style=\"color: #00f; font-weight: bold;\">-=<\/span> <span style=\"color: #0000cd;\">1<\/span>\r\n        mutex.release()\r\n<span style=\"color: #06f; font-style: italic;\"># \u0422\u043e \u0436\u0435, \u043d\u043e \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">risky_plus<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> unprotected_resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(NUM):\r\n        unprotected_resource <span style=\"color: #00f; font-weight: bold;\">+=<\/span> <span style=\"color: #0000cd;\">1<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">risky_minus<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> unprotected_resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(NUM):\r\n        unprotected_resource <span style=\"color: #00f; font-weight: bold;\">-=<\/span> <span style=\"color: #0000cd;\">1<\/span>\r\n<\/pre>\n<p>\u0412 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 safe_, \u0430 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0445 \u2014 risky_.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c 4 \u043f\u043e\u0442\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0431\u0435\u0437:<\/p>\n<pre style=\"background: #fff; color: #000;\">thread1 <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> safe_plus)\r\nthread2 <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> safe_minus)\r\nthread3 <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> risky_plus)\r\nthread4 <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> risky_minus)\r\nthread1.start()\r\nthread2.start()\r\nthread3.start()\r\nthread4.start()\r\nthread1.join()\r\nthread2.join()\r\nthread3.join()\r\nthread4.join()\r\n<span style=\"color: #00f; font-weight: bold;\">print<\/span> (<span style=\"color: #036a07;\">\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 <span style=\"color: #c5060b; font-weight: bold;\">%s<\/span>\"<\/span> <span style=\"color: #00f; font-weight: bold;\">%<\/span> protected_resource)\r\n<span style=\"color: #00f; font-weight: bold;\">print<\/span> (<span style=\"color: #036a07;\">\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 <span style=\"color: #c5060b; font-weight: bold;\">%s<\/span>\"<\/span> <span style=\"color: #00f; font-weight: bold;\">%<\/span> unprotected_resource)\r\n<\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u043e\u0434\u0440\u044f\u0434 \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0442\u0451\u0442, \u0437\u0430\u0442\u0435\u043c \u2014 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 0. \u0410 \u043f\u043e\u0442\u043e\u043a\u0438 thread3 \u0438 thread4 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0431\u0435\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u043f\u0435\u0440\u0435\u0431\u043e\u0439 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0432\u043e\u0435\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442 \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<h2 id=\"3\">\u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a?<\/h2>\n<p>\u0421\u043b\u0435\u0434\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u043d\u0435 \u0431\u044b\u043b\u043e \u0448\u0430\u043d\u0441\u0430 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0418\u043d\u0430\u0447\u0435 \u043e\u0434\u043d\u0430 \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430 \u043f\u0435\u0440\u0435\u043a\u0440\u043e\u0435\u0442 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a, \u0434\u0440\u0443\u0433\u0430\u044f \u2014 \u0434\u0440\u0443\u0433\u043e\u0439, \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u0442\u0443\u043f\u0438\u043a (deadlock). \u042d\u0442\u043e \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0438 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0432\u0438\u0441\u0430\u0435\u0442 \u0438\u043b\u0438 \u0440\u0443\u0448\u0438\u0442\u0441\u044f.<\/p>\n<style>\r\n    .insert-bn {\r\n        align-items: flex-start;\r\n        border-radius: 20px;\r\n        background: #E7EDFB;\r\n        display: flex;\r\n        flex-direction: column;\r\n        font-family: 'IBM Plex Sans', sans-serif;\r\n        justify-content: flex-start;\r\n        margin: 40px auto;\r\n        padding: 44px 40px;\r\n        position: relative;\r\n        z-index: 1;\r\n    }\r\n    .insert-bn__content {\r\n        align-items: flex-start;\r\n        display: flex;\r\n        flex-direction: column;\r\n        justify-content: flex-start;\r\n        max-width: 450px;\r\n    }\r\n    .insert-bn__content-title span,\r\n    .insert-bn__content-title {\r\n        color: #23242C;\r\n        font-family: 'IBM Plex Sans', sans-serif;\r\n        font-size: 26px;\r\n        font-weight: 700;\r\n        line-height: 36px;\r\n        margin-bottom: 19px;\r\n        text-align: left;\r\n    }\r\n    .insert-bn__content-title span {\r\n        color: #8D46F6;\r\n    }\r\n    .insert-bn__content-desc strong,\r\n    .insert-bn__content-desc {\r\n        font-size: 18px;\r\n        font-weight: 400;\r\n        line-height: 23px;\r\n        margin-bottom: 44px;\r\n        text-align: left;\r\n    }\r\n    .insert-bn__content-desc strong{\r\n        font-weight: 500;\r\n    }\r\n    .insert-bn__content-btn:visited,\r\n    .insert-bn__content-btn:focus,\r\n    .insert-bn__content-btn:hover,\r\n    .insert-bn__content-btn {\r\n        background: #8D46F6;\r\n        border: none;\r\n        border-radius: 10px;\r\n        color: #fff;\r\n        cursor: pointer;\r\n        outline: none;\r\n        font-size: 20px;\r\n        font-style: normal;\r\n        font-weight: 700;\r\n        line-height: 16px;\r\n        padding: 25px 38px;\r\n    }\r\n    .insert-bn .image_bg {\r\n        border-radius: 20px;\r\n        background: #E7EDFB;\r\n        bottom: 0;\r\n        height: 100%;\r\n        left: 0;\r\n        position: absolute;\r\n        right: 0;\r\n        top: 0;\r\n        width: 100%;\r\n        z-index: -1;\r\n    }\r\n    @media screen and (max-width: 768px) {\r\n        .insert-bn {\r\n            min-height: 525px;\r\n            padding: 28px 20px;\r\n        }\r\n        .insert-bn__content {\r\n            max-width: unset;\r\n            width: 100%;\r\n        }\r\n        .insert-bn__content-title span,\r\n        .insert-bn__content-title {\r\n            font-size: 24px;\r\n            line-height: normal;\r\n        }\r\n        .insert-bn__content-desc strong,\r\n        .insert-bn__content-desc {\r\n            font-size: 16px;\r\n            line-height: 24px;\r\n            margin-bottom: 30px;\r\n        }\r\n        .insert-bn__content-btn:visited,\r\n        .insert-bn__content-btn:focus,\r\n        .insert-bn__content-btn:hover,\r\n        .insert-bn__content-btn {\r\n            font-size: 20px;\r\n            line-height: 26px;\r\n            padding: 20px 0;\r\n            text-align: center;\r\n            width: 100%;\r\n        }\r\n    }\r\n<\/style>\r\n<div class=\"insert-bn\" id=\"insert_bn\">\r\n    <div class=\"insert-bn__content\">\r\n        <div class=\"insert-bn__content-title\">\r\n            <span>\u0414\u0430\u0440\u0438\u043c \u0441\u043a\u0438\u0434\u043a\u0443 \u043e\u0442 60%<\/span><br class=\"mob\"> \u043d\u0430 \u043a\u0443\u0440\u0441\u044b \u043e\u0442 GeekBrains \u0434\u043e&nbsp;19 \u0430\u043f\u0440\u0435\u043b\u044f        <\/div>\r\n        <div class=\"insert-bn__content-desc\">\r\n            \u0423\u0436\u0435 \u0447\u0435\u0440\u0435\u0437 9 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u043e\u0445\u043e\u0434\u043e\u043c <strong>\u043e\u0442 150 000 \u0440\u0443\u0431\u043b\u0435\u0439<\/strong>        <\/div>\r\n        <a class=\"insert-bn__content-btn\" href=\"https:\/\/gb.ru\/sale?from=blog_vrezka\">\r\n            \u0417\u0430\u0431\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u0438\u0434\u043a\u0443\r\n        <\/a>\r\n    <\/div>\r\n\r\n    <img decoding=\"async\" class=\"image_bg insert-bn-bg pc\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/insert-bn\/all.png\" alt=\"\">\r\n    <img decoding=\"async\" class=\"image_bg insert-bn-bg mob\" src=\"https:\/\/gb.ru\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/insert-bn\/all_mob.png\" alt=\"\">\r\n<\/div>\r\n\n<p>\u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u00ab\u0437\u0430\u0445\u0432\u0430\u0442\u00bb \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0430, \u043d\u0438\u0447\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u00ab\u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044e\u00bb. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e release() \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>\u041f\u0438\u0448\u0438\u0442\u0435 \u043a\u043e\u0434 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0435\u0448\u0442\u0430\u0442\u043d\u043e. \u041f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 try-except-finally:<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #00f; font-weight: bold;\">try<\/span>:\r\n    mutex.acquire()\r\n    <span style=\"color: #06f; font-style: italic;\"># \u0412\u0430\u0448 \u043a\u043e\u0434...<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">except<\/span> SomethingGoesWrong:\r\n    <span style=\"color: #06f; font-style: italic;\"># \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">finally<\/span>:\r\n    <span style=\"color: #06f; font-style: italic;\"># \u0415\u0449\u0451 \u043a\u043e\u0434<\/span>\r\n    mutex.release()\r\n<\/pre>\n<h2 id=\"4\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Python<\/h2>\n<p>\u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 Lock, \u043d\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0431\u0449\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438.<\/p>\n<h3>\u0421\u0435\u043c\u0430\u0444\u043e\u0440\u044b (Semaphore)<\/h3>\n<p>\u0421\u0435\u043c\u0430\u0444\u043e\u0440 \u2014 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u043a\u0430 \u0438\u0437 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0415\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u043b\u0438\u0448\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u043a \u0441\u0435\u0442\u0438 \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c acquire(), \u0442\u043e \u0435\u0441\u0442\u044c \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u043d\u043e\u0432\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442. \u041f\u0440\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u043d\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 release(). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0440\u0430\u0432\u043d\u043e 1.<\/p>\n<pre style=\"background: #fff; color: #000;\">s <span style=\"color: #00f; font-weight: bold;\">=<\/span> Semaphore(<span style=\"color: #0000cd;\">5<\/span>)\r\n<span style=\"color: #06f; font-style: italic;\"># \u0412 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430<\/span>\r\n<\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u00ab\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u00bb \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c BoundedSemaphore().<\/p>\n<h3>\u0421\u043e\u0431\u044b\u0442\u0438\u044f (Event)<\/h3>\n<p>\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u2014 \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u0434\u0440\u0443\u0433\u0438\u043c. \u0415\u0441\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u2014 \u0441\u0442\u0430\u0432\u044f\u0442 \u0444\u043b\u0430\u0433 \u043c\u0435\u0442\u043e\u0434\u043e\u043c .set(), \u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u2014 \u0441\u043d\u0438\u043c\u0430\u044e\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e .clear(). \u041f\u043e\u043a\u0430 \u0444\u043b\u0430\u0433\u0430 \u043d\u0435\u0442, \u0440\u0435\u0441\u0443\u0440\u0441 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d. \u0416\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0412\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0438\u0433\u0440\u0430\u0435\u0442 wait(): \u0435\u0441\u043b\u0438 \u0444\u043b\u0430\u0433 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043e\u0442\u0434\u0430\u0451\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c; \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043b\u0438 \u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0444\u043b\u0430\u0433\u0430 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/p>\n<pre style=\"background: #fff; color: #000;\">e <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Event()\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">event_manager<\/span>():\r\n    <span style=\"color: #06f; font-style: italic;\"># \u0416\u0434\u0451\u043c, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442 \u0444\u043b\u0430\u0433<\/span>\r\n    e.wait()\r\n    ...\r\n    <span style=\"color: #06f; font-style: italic;\"># \u0421\u0442\u0430\u0432\u0438\u043c \u0444\u043b\u0430\u0433<\/span>\r\n    e.set()\r\n    <span style=\"color: #06f; font-style: italic;\"># \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u043c<\/span>\r\n        ...\r\n   <span style=\"color: #06f; font-style: italic;\"># \u0421\u043d\u0438\u043c\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u0438 \u0436\u0434\u0451\u043c \u043d\u043e\u0432\u043e\u0433\u043e<\/span>\r\n   e.clear()\r\n<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0435\u0433\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445, \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: e.wait(3,0).<\/p>\n<style>\r\n    .strategy-of-beginners-new {\r\n        background: url(\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new-v2\/bg-2.jpg) no-repeat;\r\n        padding: 40px 30px 50px 30px;\r\n        margin: 10px auto;\r\n    }\r\n    .strategy-of-beginners-new__date {\r\n        font-size: 18px;\r\n        font-weight: 700;\r\n        line-height: 23px;\r\n        color: #23242C;\r\n        position: relative;\r\n        margin-left: 20px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__date:after {\r\n        content: '';\r\n        position: absolute;\r\n        background: url('\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new\/date-1.png') no-repeat;\r\n        width: 209px;\r\n        height: 57px;\r\n        left: -20px;\r\n        top: -18px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__title {\r\n        font-size: 30px;\r\n        line-height: 30px;\r\n        font-weight: 700;\r\n        color: #23242C;\r\n        margin-top: 17px;\r\n        max-width: 500px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__title span {\r\n        font-size: 30px;\r\n        color: #8D46F6;\r\n        font-weight: 700;\r\n        line-height: 30px;\r\n    }\r\n\r\n    .strategy-of-beginners-new span {\r\n        font-family: 'IBM Plex Sans';\r\n    }\r\n\r\n    .strategy-of-beginners-new__list--title {\r\n        font-size: 16px;\r\n        font-weight: 500;\r\n        color: #23242C;\r\n        line-height: 16px;\r\n        margin-bottom: 19px;\r\n        max-width: 710px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__list {\r\n        margin-top: 19px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__list--item {\r\n        display: flex;\r\n        align-items: center;\r\n        gap: 12px;\r\n        color: #6654D9;\r\n        cursor: pointer;\r\n        font-weight: 600;\r\n        font-size: 15px;\r\n        line-height: 16px;\r\n        text-decoration: underline;\r\n    }\r\n\r\n    .strategy-of-beginners-new__list--item:nth-child(3) {\r\n        margin: 8px 0;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form {\r\n        margin-top: 10px;\r\n    }\r\n    .strategy-of-beginners-new__form-wrapper {\r\n        display: flex;\r\n        align-items: flex-end;\r\n        justify-content: space-between;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form--input {\r\n        display: flex;\r\n        flex-direction: column;\r\n        min-width: 224px;\r\n        max-width: 224px;\r\n        position: relative;\r\n    }\r\n\r\n    .strategy-of-beginners-new__inputtip {\r\n        font-size: 11px;\r\n        color: #23242C;\r\n        line-height: 15px;\r\n        font-weight: 500;\r\n        margin-bottom: 6px;\r\n    }\r\n    .strategy-of-beginners-new__form--input input {\r\n        border: 0;\r\n        border-radius: 10px;\r\n        color: #828282;\r\n        font-size: 13px;\r\n        line-height: 17px;\r\n        margin-bottom: 0;\r\n        padding: 16px 15px;\r\n        width: -webkit-fill-available;\r\n    }\r\n    .strategy-of-beginners-new__form--input.input-tel-wrap {\r\n        margin-top: 10px;\r\n    }\r\n    .strategy-of-beginners-new__form--input span {\r\n        bottom: 0;\r\n        color: #f00;\r\n        display: none;\r\n        font-size: 8px;\r\n        line-height: 8px;\r\n        margin-bottom: -8px;\r\n        position: absolute;\r\n    }\r\n    .strategy-of-beginners-new__form--input.error span {\r\n        display: block;\r\n    }\r\n    .strategy-of-beginners-new__form--input.error input{\r\n        border: 1px solid #f00;\r\n    }\r\n\r\n    .strategy-of-beginners-new__inputtip .iti__selected-dial-code {\r\n        font-size: 13px;\r\n    }\r\n    .iti--separate-dial-code .iti__selected-flag {\r\n        background-color: transparent;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form--input input::placeholder {\r\n        color: #828282;\r\n    }\r\n\r\n    button.strategy-of-beginners-new__submit {\r\n        font-size: 14px;\r\n        line-height: 16px;\r\n        font-weight: 700;\r\n        background: #24D086;\r\n        border-radius: 10px;\r\n        padding: 18px;\r\n        position: relative;\r\n        color: #fff;\r\n        border: 0;\r\n        cursor: pointer;\r\n    }\r\n\r\n    .strategy-of-beginners-new__submit span {\r\n        position: absolute;\r\n        left: 50%;\r\n        transform: translateX(-50%);\r\n        bottom: -14px;\r\n        font-size: 14px;\r\n        line-height: 16px;\r\n        color: #0E0E0E;\r\n        background: #fff;\r\n        padding: 5px 15px;\r\n        border-radius: 8px;\r\n        font-weight: 600;\r\n    }\r\n\r\n    .strategy-of-beginners-new__download {\r\n        position: absolute;\r\n        left: 50%;\r\n        transform: translateX(-50%);\r\n        display: flex;\r\n        align-items: center;\r\n        min-width: 145px;\r\n        bottom: -30px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__button--container {\r\n        position: relative;\r\n    }\r\n\r\n    .strategy-of-beginners-new__download span {\r\n        font-size: 12px;\r\n        line-height: 15px;\r\n        color: #23242C;\r\n        margin-left: 6px;\r\n        font-weight: 500;\r\n    }\r\n\r\n\r\n    .strategy-of-beginners-new__form .control--checkbox {\r\n        align-items: center;\r\n        color: #7D7D7D;\r\n        display: flex;\r\n        flex-direction: row;\r\n        justify-content: flex-start;\r\n        font-weight: 400;\r\n        font-size: 12px;\r\n        line-height: 14px;\r\n        margin-top: 17px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form .checked-suc {\r\n        height: 8px;\r\n        position: relative;\r\n        margin-right: 6px;\r\n        width: 8px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form .checked-suc:not(:checked):before {\r\n        background: #fff;\r\n        border-radius: 2px;\r\n        border: 1px solid #AB72FF;\r\n        content: '';\r\n        height: 10px;\r\n        margin: -1px 0 0 -1px;\r\n        position: absolute;\r\n        left: 0;\r\n        top: 0;\r\n        width: 10px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form .checked-suc:checked:before {\r\n        background: url('..\/images\/popup\/career-23\/check.png') no-repeat center;\r\n        border-radius: 2px;\r\n        border: 1px solid #AB72FF;\r\n        content: '';\r\n        height: 10px;\r\n        margin: -1px 0 0 -1px;\r\n        position: absolute;\r\n        left: 0;\r\n        top: 0;\r\n        width: 10px;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form .control-checkbox__text {\r\n        margin-bottom: 0;\r\n        cursor: pointer;\r\n    }\r\n\r\n    .strategy-of-beginners-new__form .control-checkbox__text a:focus,\r\n    .strategy-of-beginners-new__form .control-checkbox__text a:active,\r\n    .strategy-of-beginners-new__form .control-checkbox__text a:visited,\r\n    .strategy-of-beginners-new__form .control-checkbox__text a:hover,\r\n    .strategy-of-beginners-new__form .control-checkbox__text a {\r\n        color: #AB72FF;\r\n        text-decoration: none;\r\n        outline: none;\r\n    }\r\n\r\n\r\n\r\n    @media (max-width: 1200px) {\r\n        .strategy-of-beginners-new {\r\n            padding: 24px 20px 147px 20px;\r\n            background: url(\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new-v2\/bg-2-m.jpg) no-repeat;\r\n            background-size: cover;\r\n        }\r\n        .strategy-of-beginners-new__date {\r\n            font-size: 15px;\r\n        }\r\n        .strategy-of-beginners-new__date:after {\r\n            width: 185px;\r\n            height: 57px;\r\n            left: -21px;\r\n            top: -13px;\r\n            background-size: contain;\r\n        }\r\n        .strategy-of-beginners-new__title {\r\n            font-size: 18px;\r\n            line-height: 22px;\r\n            max-width: unset;\r\n            width: 100%;\r\n        }\r\n        .strategy-of-beginners-new__title span {\r\n            font-size: 18px;\r\n            line-height: 22px;\r\n        }\r\n        .strategy-of-beginners-new__list {\r\n            margin-top: 6px;\r\n        }\r\n        .strategy-of-beginners-new__list--title {\r\n            font-size: 13px;\r\n            margin-bottom: 4px;\r\n        }\r\n        .strategy-of-beginners-new__list--item {\r\n            font-size: 13px;\r\n        }\r\n        .strategy-of-beginners-new__form {\r\n            margin-top: 13px;\r\n        }\r\n        .strategy-of-beginners-new__form-wrapper {\r\n            flex-direction: column;\r\n        }\r\n        .strategy-of-beginners-new__form--input {\r\n            min-width: 100%;\r\n            max-width: 100%;\r\n        }\r\n        #strategyForBeginnersNewTel {\r\n            width: 100%;\r\n        }\r\n        .strategy-of-beginners-new__button--container {\r\n            width: 100%;\r\n            margin-top: 10px;\r\n        }\r\n        button.strategy-of-beginners-new__submit {\r\n            width: 100%;\r\n            font-size: 14px;\r\n            line-height: 16px;\r\n            padding: 22px;\r\n        }\r\n        .strategy-of-beginners-new__submit span {\r\n            bottom: -12px;\r\n        }\r\n        .strategy-of-beginners-new__download {\r\n            bottom: -32px;\r\n        }\r\n        .strategy-of-beginners-new__download span {\r\n            font-weight: 400;\r\n        }\r\n\r\n        .strategy-of-beginners-new__form .control--checkbox {\r\n            margin-top: 35px;\r\n        }\r\n        .strategy-of-beginners-new__form .control--checkbox label {\r\n            font-size: 9px;\r\n            line-height: 12px;\r\n        }\r\n\r\n    }\r\n    @media screen and (max-width: 320px) {\r\n        .strategy-of-beginners-new__title {\r\n            font-size: 16px;\r\n        }\r\n        .strategy-of-beginners-new__title span {\r\n            font-size: 16px;\r\n        }\r\n    }\r\n<\/style>\r\n<!-- noindex -->\r\n<div class=\"strategy-of-beginners-new\">\r\n    <div class=\"strategy-of-beginners-new__date\">\r\n        \u0422\u043e\u043b\u044c\u043a\u043e \u0434\u043e 23.04    <\/div>\r\n    <div class=\"strategy-of-beginners-new__title\">\r\n        \u0421\u043a\u0430\u0447\u0430\u0439 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b <span>\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043d\u0430\u0439\u0442\u0438<\/span> \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 IT \u0437\u0430 14 \u0434\u043d\u0435\u0439\r\n    <\/div>\r\n    <div class=\"strategy-of-beginners-new__list\">\r\n        <div class=\"strategy-of-beginners-new__list--title\">\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:<\/div>\r\n        <div class=\"strategy-of-beginners-new__list--item\" onclick=\"ym(40414440, 'reachGoal', 'click-file-one-vrezkait')\">\r\n            <img decoding=\"async\" src=\"\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new\/pdf.png\">\r\n            \u0422\u041e\u041f-100 \u043f\u043b\u043e\u0449\u0430\u0434\u043e\u043a \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442 GeekBrains\r\n        <\/div>\r\n        <div class=\"strategy-of-beginners-new__list--item\" onclick=\"ym(40414440, 'reachGoal', 'click-file-two-vrezkait')\">\r\n            <img decoding=\"async\" src=\"\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new\/pdf.png\">\r\n            20 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0439 2023 \u0433\u043e\u0434\u0430, \u0441 \u0434\u043e\u0445\u043e\u0434\u043e\u043c \u043e\u0442 150 000 \u0440\u0443\u0431\u043b\u0435\u0439\r\n        <\/div>\r\n        <div class=\"strategy-of-beginners-new__list--item\" onclick=\"ym(40414440, 'reachGoal', 'click-file-three-vrezkait')\">\r\n            <img decoding=\"async\" src=\"\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new\/pdf.png\">\r\n            \u0427\u0435\u043a-\u043b\u0438\u0441\u0442 \u00ab\u041a\u0430\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435\u00bb\r\n        <\/div>\r\n    <\/div>\r\n    <form class=\"strategy-of-beginners-new__form\" method=\"post\">\r\n        <div class=\"strategy-of-beginners-new__form-wrapper\">\r\n            <div class=\"strategy-of-beginners-new__form--input\">\r\n                <div class=\"strategy-of-beginners-new__inputtip\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b, \u0443\u043a\u0430\u0436\u0438\u0442\u0435 e-mail:<\/div>\r\n                <input type=\"email\" id=\"strategyForBeginnersNewEmail\" name=\"email\" placeholder=\"E-mail, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, info@gb.ru\" required pattern=\"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$\">\r\n                <span>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 e-mail, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c<\/span>\r\n            <\/div>\r\n            <div class=\"strategy-of-beginners-new__form--input input-tel-wrap\" style=\"position: relative\">\r\n                <div class=\"strategy-of-beginners-new__inputtip\">\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u043d\u0435 \u0440\u043e\u0431\u043e\u0442,<br class=\"pc\">\u0443\u043a\u0430\u0437\u0430\u0432 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430:<\/div>\r\n                <input type=\"tel\" id=\"strategyForBeginnersNewTel\" name=\"tel\" placeholder=\"+7 (000)-000-00-00\" required>\r\n                <span>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c<\/span>\r\n            <\/div>\r\n            <div class=\"strategy-of-beginners-new__button--container\">\r\n                <button class=\"strategy-of-beginners-new__submit\" type=\"submit\">\r\n                    \u0421\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\r\n                    <span>pdf 2,5mb<\/span>\r\n                <\/button>\r\n                <div class=\"strategy-of-beginners-new__download\">\r\n                    <img decoding=\"async\" src=\"\/blog\/wp-content\/themes\/reboot-child\/assets\/images\/incut-strategy-for-beginners-new-v2\/people-3.png\">\r\n                    <span>\u0423\u0436\u0435 \u0441\u043a\u0430\u0447\u0430\u043b\u0438 52300<\/span>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <div class=\"control control--checkbox\">\r\n            <input type=\"checkbox\" checked=\"checked\" class=\"checked-suc\" id=\"strategy_of_beginners_new_popup_suc\">\r\n            <label class=\"control-checkbox__text\" for=\"strategy_of_beginners_new_popup_suc\">\r\n                \u042f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 <a href=\"https:\/\/gbcdn.mrgcdn.ru\/uploads\/staticpage\/342\/asset\/f5adf9f6d80bab3f627967e4c20b2724.pdf\">\u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>.\r\n            <\/label>\r\n            <div class=\"control__indicator\"><\/div>\r\n        <\/div>\r\n\r\n    <\/form>\r\n<\/div>\r\n<div class=\"popup popup__success\" id=\"strategyForBeginnersPopupSuccess\" style=\"display: none\">\r\n    <div class=\"strategy-for-beginners-popup__success\">\r\n        <div class=\"popup-close strategy-for-beginners-popup__success-close\">\r\n            <svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fal\" data-icon=\"times\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 320 512\" class=\"svg-inline--fa fa-times fa-w-10 fa-3x\"><path fill=\"#00000\" d=\"M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z\" class=\"\"><\/path><\/svg>\r\n        <\/div>\r\n        <p class=\"strategy-for-beginners-popup__success-title\">\u0427\u0442\u043e\u0431\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043f\u043e\u0434\u0430\u0440\u043e\u043a \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0442 GeekBrains, \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435<\/p>\r\n        <div class=\"strategy-for-beginners-popup__success-actions\">\r\n            <a id=\"popupStrategyForBeginnersTarget\" href = \"https:\/\/gb.ru\/a\/a_blog3\" target=\"_blank\" onClick=\"ym(40414440, 'reachGoal', 'clickmodalkavrezkavolchek');\">\u041f\u0435\u0440\u0435\u0439\u0442\u0438<\/a>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\r\n<a class=\"prof_link\" style=\"display:none;\" href=\"https:\/\/gb.ru\/a\/a_blog3\" target=\"_blank\">\u0410\u043d\u043a\u0435\u0442\u0430<\/a>\r\n<!-- \/noindex -->\r\n\n<p>\u041c\u0435\u0442\u043e\u0434 is_set() \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0435. \u0412\u0430\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u0432 \u043f\u043e\u043b\u0435 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432-\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0435\u0439 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u0418\u043d\u0430\u0447\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0441\u044f.<\/p>\n<h3>\u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 (RLock)<\/h3>\n<p>\u0422\u0430\u043a\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443. \u0427\u0438\u0441\u043b\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 .acquire() \u0438 .release() \u043d\u0435 \u0434\u0430\u0441\u0442 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 \u0437\u0430\u043f\u0443\u0442\u0430\u0442\u044c\u0441\u044f, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u043e\u0442\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0430\u0432\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441, \u0430 \u043a\u043e\u0433\u0434\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0434\u043e \u0441\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u0435 RLock:<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #0c450d; font-weight: bold;\">import<\/span> threading, random\r\ncounter <span style=\"color: #00f; font-weight: bold;\">=<\/span> <span style=\"color: #0000cd;\">0<\/span>\r\nre_mutex <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.RLock()\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">step_one<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> counter\r\n    re_mutex.acquire()\r\n    counter <span style=\"color: #00f; font-weight: bold;\">=<\/span> random.randint(<span style=\"color: #0000cd;\">1<\/span>,<span style=\"color: #0000cd;\">100<\/span>)\r\n    <span style=\"color: #00f; font-weight: bold;\">print<\/span>(<span style=\"color: #036a07;\">\"Random number <span style=\"color: #c5060b; font-weight: bold;\">%s<\/span>\"<\/span> <span style=\"color: #00f; font-weight: bold;\">%<\/span> counter)\r\n    re_mutex.release()\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">step_two<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> counter\r\n    re_mutex.acquire()\r\n    counter <span style=\"color: #00f; font-weight: bold;\">*=<\/span> <span style=\"color: #0000cd;\">2<\/span>\r\n    <span style=\"color: #00f; font-weight: bold;\">print<\/span>(<span style=\"color: #036a07;\">\"Doubled = <span style=\"color: #c5060b; font-weight: bold;\">%s<\/span>\"<\/span> <span style=\"color: #00f; font-weight: bold;\">%<\/span> counter)\r\n    re_mutex.release()\r\n <span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">walkthrough<\/span>():\r\n    re_mutex.acquire()\r\n    <span style=\"color: #00f; font-weight: bold;\">try<\/span>:\r\n        step_one()\r\n        step_two()\r\n    <span style=\"color: #00f; font-weight: bold;\">finally<\/span>:\r\n        re_mutex.release()\r\nt <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> walkthrough)\r\nt2 <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Thread(<span style=\"font-style: italic;\">target<\/span> <span style=\"color: #00f; font-weight: bold;\">=<\/span> walkthrough)\r\nt.start()\r\nt2.start()\r\nt.join()\r\nt2.join()\r\n<\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u044d\u0442\u043e \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u0435\u0440\u043d\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0443\u0431\u0440\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 walkthrough:<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">walkthrough<\/span>():\r\n        step_one()\r\n        step_two()\r\n<\/pre>\n<p>\u0415\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u0434 \u2014 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u0441\u044f. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0443\u043c\u043d\u043e\u0436\u0438\u0442 \u043d\u0430 2 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0434\u0432\u043e\u0438\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (Condition)<\/h3>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u2014 \u0443\u0441\u043b\u043e\u0436\u043d\u0451\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (Event). \u0427\u0435\u0440\u0435\u0437 Condition \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441 \u0441\u0442\u0430\u0432\u044f\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0438 \u043e\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e\u0435 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u041e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438:<\/p>\n<ul>\n<li>notify() \u2014 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430;<\/li>\n<li>notifyAll() \u2014 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432.<\/li>\n<\/ul>\n<p>\u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #06f; font-style: italic;\"># \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0443\u044e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443<\/span>\r\nmutex <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.RLock()\r\n<span style=\"color: #06f; font-style: italic;\"># \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439<\/span>\r\ncond <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Condition(mutex)\r\n<span style=\"color: #06f; font-style: italic;\"># \u041f\u043e\u0442\u043e\u043a-\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044c \u0436\u0434\u0451\u0442 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0438 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">consumer<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">while<\/span> <span style=\"color: #585cf6; font-weight: bold;\">True<\/span>:\r\n            cond.acquire()\r\n            <span style=\"color: #00f; font-weight: bold;\">while<\/span> <span style=\"color: #00f; font-weight: bold;\">not<\/span> resourse_free():\r\n            cond.wait()\r\n            get_free_resource()\r\n            cond.release()\r\n<span style=\"color: #06f; font-style: italic;\"># \u041f\u043e\u0442\u043e\u043a-\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u0435\u0442 \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f<\/span>\r\n<span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">producer<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">while<\/span> <span style=\"color: #585cf6; font-weight: bold;\">True<\/span>:\r\n            cond.acquire()\r\n            unblock_resource()\r\n            <span style=\"color: #06f; font-style: italic;\"># \u0421\u0438\u0433\u043d\u0430\u043b\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u0443: \"\u041d\u0430\u043b\u0435\u0442\u0430\u0439 \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435!\"<\/span>\r\n            cond.notify()\r\n            cond.release()\r\n<\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u044f\u0437\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f.<\/p>\n<pre style=\"background: #fff; color: #000;\">cond <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Condition(mutex)\r\nanother_cond <span style=\"color: #00f; font-weight: bold;\">=<\/span> threading.Condition(mutex)\r\n<\/pre>\n<h2 id=\"5\">\u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0441 with<\/h2>\n<p>\u041f\u0440\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0443\u0447\u0430\u0441\u0442\u043a\u043e\u0432 \u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u00ab\u0437\u0430\u0445\u0432\u0430\u0442\u00bb \u0438 \u00ab\u0432\u044b\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u00bb \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c with. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 with, \u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0438 \u043d\u0435 \u043f\u0440\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438. \u0423 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 with, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<ul>\n<li>\u00ab\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435\u00bb \u2014 \u043c\u0435\u0442\u043e\u0434 __enter__(). \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438;<\/li>\n<li>\u00ab\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435\u00bb \u2014 \u043c\u0435\u0442\u043e\u0434 __exit__(). \u041e\u043d \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430 \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u0430. \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u044f\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 \u0438\/\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0435\u0430\u043a\u0446\u0438\u044e \u043d\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u044b.<\/li>\n<\/ul>\n<p>\u0423\u0434\u0430\u0447\u0430! \u0423 \u043d\u0430\u0448\u0435\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 Lock \u044d\u0442\u0438 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0443\u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u044e\u0431\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Lock \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 with \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0430\u043c\u0430 \u0441\u043d\u0438\u043c\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0439\u0434\u0435\u0442 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b with-\u0431\u043b\u043e\u043a\u0430:<\/p>\n<pre style=\"background: #fff; color: #000;\"><span style=\"color: #00f; font-weight: bold;\">def<\/span> <span style=\"color: #0000a2; font-weight: bold;\">safe_plus<\/span>():\r\n    <span style=\"color: #00f; font-weight: bold;\">global<\/span> protected_resource\r\n    <span style=\"color: #00f; font-weight: bold;\">for<\/span> i <span style=\"color: #00f; font-weight: bold;\">in<\/span> <span style=\"color: #3c4c72; font-weight: bold;\">range<\/span>(NUM):\r\n        <span style=\"color: #00f; font-weight: bold;\">with<\/span> mutex:\r\n protected_resource <span style=\"color: #00f; font-weight: bold;\">+=<\/span> <span style=\"color: #0000cd;\">1<\/span>\r\n<span style=\"color: #06f; font-style: italic;\"># \u0418 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 acquire-release!<\/span>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f: \u041f\u0440\u043e\u0441\u0442\u0430\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u0432 Python \u0421 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u043c\u0438 \u0438 \u0431\u0435\u0437. \u041f\u0440\u0438\u043c\u0435\u0440\u2013\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u041a\u0430\u043a \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a? \u0414\u0440\u0443\u0433\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Python \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":17301,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438<\/title>\n<meta name=\"description\" content=\"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438\" \/>\n<meta property=\"og:description\" content=\"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\" \/>\n<meta property=\"og:site_name\" content=\"GeekBrains\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-08T14:50:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T15:55:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2023\/08\/yazyki-programmirovaniya-dlya-nachinayushhih-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u043c\u0438\u043d\u0443\u0442\u044b\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\"},\"author\":{\"name\":\"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f\",\"@id\":\"https:\/\/gb.ru\/blog\/#\/schema\/person\/5024763dc5b29700032d4627ed96e8e8\"},\"headline\":\"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438\",\"datePublished\":\"2018-06-08T14:50:02+00:00\",\"dateModified\":\"2023-12-06T15:55:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\"},\"wordCount\":999,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/gb.ru\/blog\/#organization\"},\"articleSection\":[\"\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\"],\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\",\"url\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\",\"name\":\"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438\",\"isPartOf\":{\"@id\":\"https:\/\/gb.ru\/blog\/#website\"},\"datePublished\":\"2018-06-08T14:50:02+00:00\",\"dateModified\":\"2023-12-06T15:55:08+00:00\",\"description\":\"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.\",\"breadcrumb\":{\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/gb.ru\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gb.ru\/blog\/#website\",\"url\":\"https:\/\/gb.ru\/blog\/\",\"name\":\"GeekBrains\",\"description\":\"\u0411\u043b\u043e\u0433\",\"publisher\":{\"@id\":\"https:\/\/gb.ru\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gb.ru\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gb.ru\/blog\/#organization\",\"name\":\"\u041e\u041e\u041e \u00ab\u0413\u0438\u043a\u0411\u0440\u0435\u0438\u043d\u0441\u00bb\",\"url\":\"https:\/\/gb.ru\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/gb.ru\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2021\/10\/Logo-geekbrains.png\",\"contentUrl\":\"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2021\/10\/Logo-geekbrains.png\",\"width\":234,\"height\":29,\"caption\":\"\u041e\u041e\u041e \u00ab\u0413\u0438\u043a\u0411\u0440\u0435\u0438\u043d\u0441\u00bb\"},\"image\":{\"@id\":\"https:\/\/gb.ru\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/gb.ru\/blog\/#\/schema\/person\/5024763dc5b29700032d4627ed96e8e8\",\"name\":\"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/gb.ru\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a54fc60a08e07424ac45b4e7cb7b47b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a54fc60a08e07424ac45b4e7cb7b47b3?s=96&d=mm&r=g\",\"caption\":\"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f\"},\"url\":\"https:\/\/gb.ru\/blog\/author\/mariya-lisyanskaya\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438","description":"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/","og_locale":"ru_RU","og_type":"article","og_title":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438","og_description":"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.","og_url":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/","og_site_name":"GeekBrains","article_published_time":"2018-06-08T14:50:02+00:00","article_modified_time":"2023-12-06T15:55:08+00:00","og_image":[{"width":1920,"height":550,"url":"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2023\/08\/yazyki-programmirovaniya-dlya-nachinayushhih-3.jpg","type":"image\/jpeg"}],"author":"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"2 \u043c\u0438\u043d\u0443\u0442\u044b"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#article","isPartOf":{"@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/"},"author":{"name":"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f","@id":"https:\/\/gb.ru\/blog\/#\/schema\/person\/5024763dc5b29700032d4627ed96e8e8"},"headline":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438","datePublished":"2018-06-08T14:50:02+00:00","dateModified":"2023-12-06T15:55:08+00:00","mainEntityOfPage":{"@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/"},"wordCount":999,"commentCount":0,"publisher":{"@id":"https:\/\/gb.ru\/blog\/#organization"},"articleSection":["\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435"],"inLanguage":"ru-RU","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/","url":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/","name":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438","isPartOf":{"@id":"https:\/\/gb.ru\/blog\/#website"},"datePublished":"2018-06-08T14:50:02+00:00","dateModified":"2023-12-06T15:55:08+00:00","description":"\u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0438\u0441\u044c \u0441 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 GIL. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0438. \u041e\u043d\u0438 \u0437\u0430\u0449\u0438\u0442\u044f\u0442 \u043a\u043e\u0434 \u043e\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043e\u0431\u0449\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.","breadcrumb":{"@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gb.ru\/blog\/python-multithreading-pt2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gb.ru\/blog\/python-multithreading-pt2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/gb.ru\/blog\/"},{"@type":"ListItem","position":2,"name":"Python \u0432 \u0442\u0440\u0438 \u0440\u0443\u0447\u044c\u044f (\u0447\u0430\u0441\u0442\u044c 2). \u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438"}]},{"@type":"WebSite","@id":"https:\/\/gb.ru\/blog\/#website","url":"https:\/\/gb.ru\/blog\/","name":"GeekBrains","description":"\u0411\u043b\u043e\u0433","publisher":{"@id":"https:\/\/gb.ru\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gb.ru\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ru-RU"},{"@type":"Organization","@id":"https:\/\/gb.ru\/blog\/#organization","name":"\u041e\u041e\u041e \u00ab\u0413\u0438\u043a\u0411\u0440\u0435\u0438\u043d\u0441\u00bb","url":"https:\/\/gb.ru\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/gb.ru\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2021\/10\/Logo-geekbrains.png","contentUrl":"https:\/\/gb.ru\/blog\/wp-content\/uploads\/2021\/10\/Logo-geekbrains.png","width":234,"height":29,"caption":"\u041e\u041e\u041e \u00ab\u0413\u0438\u043a\u0411\u0440\u0435\u0438\u043d\u0441\u00bb"},"image":{"@id":"https:\/\/gb.ru\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/gb.ru\/blog\/#\/schema\/person\/5024763dc5b29700032d4627ed96e8e8","name":"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/gb.ru\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a54fc60a08e07424ac45b4e7cb7b47b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a54fc60a08e07424ac45b4e7cb7b47b3?s=96&d=mm&r=g","caption":"\u041c\u0430\u0440\u0438\u044f \u041b\u0438\u0441\u044f\u043d\u0441\u043a\u0430\u044f"},"url":"https:\/\/gb.ru\/blog\/author\/mariya-lisyanskaya\/"}]}},"_links":{"self":[{"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/posts\/17667"}],"collection":[{"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/comments?post=17667"}],"version-history":[{"count":3,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/posts\/17667\/revisions"}],"predecessor-version":[{"id":22277,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/posts\/17667\/revisions\/22277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/media\/17301"}],"wp:attachment":[{"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/media?parent=17667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/categories?post=17667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gb.ru\/blog\/wp-json\/wp\/v2\/tags?post=17667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}