{"id":195770,"date":"2013-10-01T10:12:05","date_gmt":"2013-10-01T06:12:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=195770"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=195770","title":{"rendered":"<span class=\"post_title\">Lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. 1 \u2014 \u041d\u0430\u0447\u0430\u043b\u043e<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/164\/b7f\/0d6\/164b7f0d6398bcfaab421f7d957a9acf.jpg\" align=\"right\"\/><br \/>  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0446\u0438\u043a\u043b\u0430 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043e lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0445\u0430\u0431\u0440\u0430\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c \u0438 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u043b\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 STL \u043a lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c, \u0438 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 (\u0438 \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435) \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0420\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043e lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d \u0431\u0435\u0437 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u043c, \u043a\u0430\u043a \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0435\u0441\u043b\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044f\u0437\u044b\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e \u0441\u0432\u043e\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438), \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0438\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u2014 \u0432\u0441\u0435 \u044d\u0442\u0438 \u0442\u0435\u043c\u044b \u0431\u0443\u0434\u0443\u0442 \u0432 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435. \u042f \u0431\u0435\u0440\u0443 \u043d\u0430 \u0441\u0435\u0431\u044f \u0441\u043c\u0435\u043b\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0432\u0435\u0449\u0430\u0445, \u0445\u043e\u0442\u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u0441\u0435\u0431\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043d\u0435 \u0438\u043c\u0435\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u043d\u0438\u0445, \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"http:\/\/libcds.sourceforge.net\">libcds<\/a>, \u2014 open source C++ \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (safe memory reclamation). Cds \u2013 \u044d\u0442\u043e \u0430\u0431\u0431\u0440\u0435\u0432\u0438\u0430\u0442\u0443\u0440\u0430 Concurrent Data Structure, \u0430 \u043f\u0440\u0435\u0444\u0438\u043a\u0441 \u201clib\u201d \u2013 \u044d\u0442\u043e, \u043a\u0430\u043a \u043d\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u201clibrary\u201d.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0443 \u044f \u0441 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2006 \u0433\u043e\u0434\u0443.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">2006 \u0433\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/ca0\/158\/bda\/ca0158bda7da023178fdd27eff376b67.jpg\"\/>  <\/div>\n<\/div>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0440\u0443\u043f\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043f\u0438\u0448\u0443\u0449\u0435\u0439 \u0441\u043e\u0444\u0442 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0435\u043b\u0435\u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0437 \u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0422\u0440\u043e\u0439\u043a\u0438. \u041c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0437\u043e\u043e\u043f\u0430\u0440\u043a\u0430 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441\u0442\u043e\u044f\u043b\u0430 (\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u043e\u044f\u0442\u044c) \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041e\u043d\u0430 \u0440\u0435\u0448\u0430\u043b\u0430\u0441\u044c, \u0432 \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0432\u043e\u0434\u0438\u0442\u0441\u044f, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u043e\u0431\u0449\u0438\u0445 (shared) \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c. \u041a\u0430\u043a-\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439 \u043c\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u0433\u0430 \u043f\u043e\u0445\u043e\u0434\u044f \u0441\u043f\u0440\u043e\u0441\u0438\u043b: \u201c\u0430 \u0442\u044b \u0441\u043b\u044b\u0448\u0430\u043b \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043e lock-free \u043e\u0447\u0435\u0440\u0435\u0434\u044f\u0445?\u201d \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u044f \u043d\u0435 \u0437\u043d\u0430\u043b \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e. \u041d\u043e, \u0441\u043f\u0440\u043e\u0441\u0438\u0432 \u0443 \u0433\u0443\u0433\u043b\u0430, \u043d\u0430\u0448\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434 lock-free \u043e\u0447\u0435\u0440\u0435\u0434\u0438. \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b. \u0422\u043e\u0447\u043d\u0435\u0435, \u044f \u043f\u0435\u0440\u0435\u0448\u0435\u043b \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u201c\u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b\u201d \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a, \u0437\u0430\u0441\u0443\u0447\u0438\u0432 \u0440\u0443\u043a\u0430\u0432\u0430 \u0438 \u0441\u043a\u0430\u0437\u0430\u0432 \u201c\u0449\u0430\u0441!\u201d \u0432\u0441\u0435\u043c\u0443 \u043c\u0438\u0440\u0443 (\u043c\u043e\u043b, \u0432\u0441\u0435 \u0432\u044b \u0434\u0443\u0440\u0430\u043a\u0438, \u043e\u0434\u0438\u043d \u044f \u0442\u0443\u0442 \u0443\u043c\u043d\u044b\u0439), \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u201c\u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c\u201d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043f\u0440\u0438\u0432\u0435\u0434\u044f \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u043e \u0437\u0434\u0440\u0430\u0432\u044b\u043c \u0441\u043c\u044b\u0441\u043b\u043e\u043c. \u0421\u043f\u0443\u0441\u0442\u044f \u043c\u0435\u0441\u044f\u0446 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 segmentation fault, \u043c\u043e\u0439 \u0437\u0434\u0440\u0430\u0432\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u0441\u0434\u0430\u043b\u0441\u044f. \u0412\u043e\u0442 \u0442\u043e\u0433\u0434\u0430 \u044f \u0438 \u201c\u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043d\u044f\u043b\u201d. \u042f \u043d\u0435 \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a \u042d\u0422\u041e \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0438 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u041e\u041d\u041e \u043a\u0430\u043a-\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 C++. \u041d\u043e \u0432\u0435\u0434\u044c \u043a\u0430\u043a-\u0442\u043e \u043e\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438\u043d\u0430\u0447\u0435 \u0443\u043c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u0431\u044b \u044d\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u043c\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0431\u044b \u043d\u0435 \u0441\u0441\u044b\u043b\u0430\u043b\u0438\u0441\u044c (\u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u044b\u043b\u0438 \u043d\u0430\u0443\u0447\u043d\u044b\u043c\u0438, \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u0430\u0436\u0434\u043e\u0439, \u043a\u0430\u043a \u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0430\u0443\u0447\u043d\u043e\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435, \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b). \u0421\u043b\u0435\u0434\u0443\u044f \u044d\u0442\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0430\u043c, \u0437\u0430 \u0433\u043e\u0434 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043c\u0435\u0433\u0430\u0431\u0430\u0439\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 software developer guide \u043f\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u043c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u043e\u0431\u0437\u043e\u0440\u043d\u044b\u043c\u0438 \u0441\u0442\u0430\u0442\u044c\u044f\u043c\u0438 \u043f\u043e \u043e\u0431\u0449\u0438\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 lock-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041f\u043e\u043f\u0443\u0442\u043d\u043e \u044f \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b (\u043d\u0430 C++, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f) \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044f \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f (\u0433\u043e\u0434 2006-2007) \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u0435\u0449\u0451 \u043e\u043f\u0442\u0438\u043c\u0438\u0441\u0442\u0438\u0447\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u043b\u0441\u044f C++0x, \u0432 STL \u0435\u0449\u0451 \u043d\u0435 \u0431\u044b\u043b\u043e \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432, \u0434\u0430 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441  \u0435\u0449\u0451 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043c\u0435\u0447\u0430\u043b\u0441\u044f, \u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u044b \u0438\u043d\u043e\u0433\u0434\u0430 \u043a\u0430\u043f\u0440\u0438\u0437\u043d\u0438\u0447\u0430\u043b\u0438 \u043d\u0430 \u043c\u043e\u0438\u0445 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u0445 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 \u043e\u0441\u043e\u0431\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445. \u041a 2008 \u0433\u043e\u0434\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430\u0447\u0430\u043b\u0438 \u043e\u0431\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0443\u043c\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0442\u0443\u0440\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libcds. \u041f\u0435\u0440\u0432\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445 \u0434\u0430\u043b\u0438 \u043e\u0431\u043d\u0430\u0434\u0451\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435, \u0438\u043d\u043e\u0433\u0434\u0430 \u043e\u0448\u0435\u043b\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 (\u201c\u044d\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 50 \u0440\u0430\u0437!!!\u201d), \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0438 \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0432 \u043c\u0438\u0440 lock-free. \u0412 2010 \u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u043d\u0430 SourceForge \u043f\u0435\u0440\u0432\u0443\u044e (0.5.0) \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u0432\u0435\u0436\u0430\u0439\u0448\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2013 1.4.0, \u0438\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430 \u043d\u0430\u0434 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 1.5.0.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0443 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u043e\u0431\u0437\u043e\u0440\u0443 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u0442\u0430\u043a, \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445, \u2014 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0434\u0430\u0436\u0435 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u0448\u0435\u0442, \u2013 \u044d\u0442\u043e \u043c\u043d\u043e\u0433\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 (threads) \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u043a\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (shared data); \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0448\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0442\u0430\u043a\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/e4a\/b16\/0ce\/e4ab160cefac1784b378f1a3b76b118a.jpg\" align=\"right\"\/><br \/>  \u0412 80-\u0445 \u0433\u043e\u0434\u0430\u0445 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0432\u0435\u043a\u0430 \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0410\u043f\u043e\u043b\u043e\u0433\u0435\u0442\u043e\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b \u041d\u0438\u043a\u043e\u043b\u0430\u0441 \u0412\u0438\u0440\u0442, \u0430\u0432\u0442\u043e\u0440 \u044f\u0437\u044b\u043a Pascal, \u043d\u0430\u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0439 \u0431\u0435\u0441\u0442\u0441\u0435\u043b\u043b\u0435\u0440 \u201c\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b + \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 = \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u201d. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0430\u0431\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 API \u0442\u0438\u043f\u0430 pthreads, Win32 API, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438: API \u0434\u0430\u044e\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (\u044d\u0442\u043e \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u2013 \u043f\u043e\u0442\u043e\u043a\u0438, threads), \u043d\u043e \u043d\u0435 \u0434\u0430\u044e\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e API \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 <i>\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/i> \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u041f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0443\u0442\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u2013 \u044d\u0442\u043e \u0430\u043d\u0442\u0438\u043f\u043e\u0434 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438: \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u2013 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0435\u043a\u0446\u0438\u044f\u043c\u0438, \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0430\u043c\u0438 (mutex), \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 (condvar); \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u043e\u0442\u043e\u043a\u0438 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0443\u0431\u0438\u0432\u0430\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u044f\u0434\u0440\u0430 \u041e\u0421, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0438\u043c: \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u044f\u0434\u0440\u0430 \u041e\u0421, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u044b\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u043f\u0440. \u0418 \u0432\u0441\u0435 \u044d\u0442\u043e, \u0431\u044b\u0442\u044c \u043c\u043e\u0436\u0435\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443-\u0434\u0432\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u041d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c (\u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0438 \u0435\u0441\u0442\u044c) \u043e\u0447\u0435\u043d\u044c \u0432\u0435\u043b\u0438\u043a\u0438. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u044f\u0434\u0440\u0430 \u041e\u0421 \u2013 \u044d\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0440\u0435\u0441\u0443\u0440\u0441.<\/p>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0430\u0431\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c. \u041f\u0440\u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0443\u0437\u043a\u0438\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b; \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0451 \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (high contention).<\/p>\n<p>  \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443\u044f\u0441\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439 \u0412\u0438\u0440\u0442\u0430 \u201c\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b + \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 = \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u201d, \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043d\u0430\u0434 libcds \u044f \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e for-each. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2013 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043f\u0438\u0441\u043e\u043a, map, set \u0438 \u0442.\u043f, \u2014 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 lock-free \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (safe memory reclamation). \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438. \u0422\u0430\u043a \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e: \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0445 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043b\u0438 map, \u0438 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u201c\u043b\u0443\u0447\u0448\u0435\u201d: \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u201c\u043b\u0443\u0447\u0448\u0435\u201d \u0438\u043b\u0438 \u201c\u0445\u0443\u0436\u0435\u201d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0436\u0435\u043b\u0435\u0437\u0430 \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0448\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u043d\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0448\u044c \u0435\u0433\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438, \u043d\u0435 \u043f\u043e\u0439\u043c\u0435\u0448\u044c, \u043b\u0443\u0447\u0448\u0435 \u043e\u043d \u0438\u043b\u0438 \u043d\u0435\u0442. \u041d\u0443 \u0430 \u0435\u0441\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u043e\u0442\u043b\u0430\u0436\u0435\u043d, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0435\u043c\u0443 \u043d\u0435 \u0437\u0430\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0451 \u043c\u0435\u0441\u0442\u043e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 (\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043b\u0435\u0433\u043a\u0438\u0439 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e)?..   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u0435\u0442\u0435\u043d\u0437\u0438\u044f \u043a STL: \u043f\u043e\u0447\u0435\u043c\u0443, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, map \u0432\u043e \u0432\u0441\u0435\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 STL \u0441\u0434\u0435\u043b\u0430\u043d \u043a\u0430\u043a red-black tree? \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 map, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, AVL tree, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c \u0434\u0435\u0440\u0435\u0432\u043e\u043c, \u043d\u043e \u0441 \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u043c \u0441\u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u0438 (\u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u2013 \u043d\u0430\u0448\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430). \u0412\u0438\u0434\u0438\u043c\u043e, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u043d\u044f \u043c\u0443\u0447\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b: \u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 red-black tree \u0438 AVL tree, \u0438 \u0432\u044b\u0432\u043e\u0434\u044b \u0432 \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0431\u044b\u043b\u0438 \u043d\u0435 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 red-black tree: \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445 (\u0438 \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445) AVL tree \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/5f1\/833\/885\/5f18338855598374617bffdca89a9972.jpeg\" align=\"right\"\/><br \/>  \u0412 \u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439:  <\/p>\n<ul>\n<li>Lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li>Fine-grained algorithms;<\/li>\n<li>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c (transactional memory)<\/li>\n<\/ul>\n<p>  \u0412 libcds \u043d\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u2013 \u044d\u0442\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439, \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0442, \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0447\u0442\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c (commit) \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c (rollback). \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0436\u0435\u043b\u0435\u0437\u0435; \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u043e\u0444\u0442\u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u043e \u043f\u0440\u0438\u0437\u043d\u0430\u043d\u0438\u044e \u0441\u0430\u043c\u0438\u0445 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u0420\u0430\u0434\u0438 \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b Intel \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b Haswell \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043c\u0430\u043d\u0434, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0441\u0446\u0432\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0435 \u0437\u0430 \u0433\u043e\u0440\u0430\u043c\u0438.<\/p>\n<p>  Fine-grained \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u2013 \u044d\u0442\u043e \u0438\u0437\u043e\u0449\u0440\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 OC, \u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u201c\u043b\u0435\u0433\u043a\u0438\u0445\u201d \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 spin-lock. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0443\u0437\u043b\u0430 (node) \u0438\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (page, bucket) \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u0441\u0430\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439. \u0427\u0430\u0441\u0442\u043e fine-grained \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0441\u0440\u0430\u0432\u043d\u0438\u043c\u0443\u044e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 libcds \u043d\u0435 \u0431\u0440\u0435\u0437\u0433\u0443\u0435\u0442 \u0442\u0430\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  Lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 <i>\u0432\u043d\u0435\u0448\u043d\u0435\u0439<\/i> \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u042d\u0442\u043e \u043d\u0435\u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u0447\u0438\u0441\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u043d\u0438\u043c. \u0421\u043b\u043e\u0432\u043e \u201c\u0432\u043d\u0435\u0448\u043d\u0435\u0439\u201d \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e: \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u0432\u0441\u0435 \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f. \u041d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0432 lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 <i>\u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c<\/i> \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u043c <i>\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/i>, \u0437\u0430\u0448\u0438\u0442\u044b\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u043b\u0438\u0431\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u0443\u0437\u043b\u043e\u0432, buckets, \u0441\u0442\u0440\u0430\u043d\u0438\u0446).<\/p>\n<p>  \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 lock-free \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0437\u0432\u0443\u0447\u0438\u0442 \u0442\u0430\u043a [Her91]: \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f lock-free \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c (\u043d\u0435\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c\u044b\u043c, non-blocking \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c), \u0435\u0441\u043b\u0438 \u043e\u043d \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e <i>\u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439<\/i> \u043f\u043e\u0442\u043e\u043a \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0437\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0448\u0430\u0433\u043e\u0432 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u044d\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438\u0441\u044c \u043a\u0440\u0430\u0445\u043e\u043c). \u0411\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u043e\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 wait-free \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0433\u043b\u0430\u0441\u0438\u0442: \u043e\u0431\u044a\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f wait-free, \u0435\u0441\u043b\u0438 <i>\u043a\u0430\u0436\u0434\u044b\u0439<\/i> \u043f\u043e\u0442\u043e\u043a \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0437\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0448\u0430\u0433\u043e\u0432. \u0423\u0441\u043b\u043e\u0432\u0438\u0435 lock-free \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0441\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 wait-free \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 linearizability [Her90], \u0438\u0433\u0440\u0430\u044e\u0449\u0435\u0435 \u0432\u0430\u0436\u043d\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430\u0445 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 lock-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u0443\u0435\u043c\u044b\u043c (linearizable), \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0438\u0434\u0435\u043d \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0438\u0434\u0435\u043d \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438. \u0417\u0432\u0443\u0447\u0438\u0442 \u043f\u043e-\u0438\u0434\u0438\u043e\u0442\u0441\u043a\u0438, \u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u043d\u0435\u0430\u0440\u0438\u0437\u0443\u0435\u043c\u044b\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0441\u044f\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0431\u0443\u0444\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430: \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043d\u0435\u043a\u0438\u0439 \u0431\u0443\u0444\u0435\u0440, \u0434\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u201c\u0432\u0441\u0442\u0430\u0432\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a\u201d \u0438 \u043d\u0435 \u0436\u0434\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d; \u0438\u043b\u0438 \u0436\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440\u0435 \u043d\u0430\u043a\u043e\u043f\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435; \u0432\u0441\u0451, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e <i>\u0431\u0443\u0434\u0435\u0442<\/i> (\u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f!) \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u043b\u0438 \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>  \u042d\u0442\u0438 \u043f\u043e\u043d\u044f\u0442\u0438\u044f \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u0430\u0443\u0447\u043d\u043e-\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u0445; \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0443\u0447\u043d\u043e-\u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u0440\u043c\u0438\u043d lock-free \u0432 \u201c\u043e\u0431\u044b\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u201d \u0441\u043c\u044b\u0441\u043b\u0435 \u0434\u043b\u044f \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438, \u043b\u0438\u0431\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0445 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435 2 &#8212; \u041e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (\u043f\u0440\u0438\u0447\u0438\u043d\u043d\u043e-\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439) \u043a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437\u043c\u044b\u0442\u043e \u0432 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0442\u0430\u043a: \u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443, \u0447\u0442\u043e-\u0442\u043e \u0441 \u043d\u0438\u043c \u0434\u0435\u043b\u0430\u0435\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442), \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u0412 lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0432\u0441\u0451 \u043d\u0435 \u0442\u0430\u043a. \u041d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u043b true, \u0437\u043d\u0430\u0447\u0438\u0442, \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u2014 \u043e\u043d \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c. \u042d\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 a la STL, \u2014 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430\u0440\u0443\u0436\u0443; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432, \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f \u0432 STL, \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u043a \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439.  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/4f6\/f3a\/bc3\/4f6f3abc3faf14554489fbecca63ea6a.jpg\"\/><br \/>  \u0427\u0435\u043c \u0436\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0442\u0441\u044f lock-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b? \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u2013 \u044d\u0442\u043e \u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0412\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0435, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435? \u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>struct Node { \t\tNode * m_pNext ; }; class queue { \t\tNode * m_pHead ; \t\tNode * m_pTail ; public: \t\tqueue(): m_pHead( NULL ), m_pTail( NULL ) {} \t\tvoid enqueue( Node * p ) \t\t{ \t\t\tp-&gt;m_pNext = m_pTail ; \t\t\tm_pTail = p ; \t\t\tif ( !m_pHead ) \t\t\t\tm_pHead = p ; \t\t} \t\tNode * dequeue() \t\t{ \t\t\tif ( !m_pHead ) return NULL ; \t\t\tNode * p = m_pHead ; \t\t\tm_pHead = p-&gt;m_pNext ; \t\t\tif ( !m_pHead ) \t\t\t\tm_pTail = NULL ; \t\t\treturn p ; \t\t} }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0435\u0449\u0451 \u043a\u043e\u0440\u043e\u0447\u0435. \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043c\u0435\u0442\u043e\u0434\u044b enqueue\/dequeue (\u0441\u0438\u043d\u043e\u043d\u0438\u043c\u044b push\/pop) \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 lock-free \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u041c\u0430\u0439\u043a\u043b\u0430 &#038; \u0421\u043a\u043e\u0442\u0442\u0430 ([Mic96], \u043a\u043e\u0434 \u0432\u0437\u044f\u0442 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u0430 <code>cds::intrusive::MSQueue<\/code> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libcds):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u043e\u0447\u0435\u043d\u044c \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>bool enqueue( value_type& val ) {       node_type * pNew = node_traits::to_node_ptr( val )  ;        typename gc::Guard guard    ;       back_off bkoff  ;        node_type * t    ;        while ( true ) {            t = guard.protect( m_pTail, node_to_value() )  ;             node_type * pNext = t-&gt;m_pNext.load(memory_model::memory_order_acquire)  ;            if ( pNext != null_ptr&lt;node_type *&gt;() ) {                 \/\/ Tail is misplaced, advance it                 m_pTail.compare_exchange_weak( t, pNext, memory_model::memory_order_release,                                                                                   CDS_ATOMIC::memory_order_relaxed ) ;                 continue    ;            }            node_type * tmp = null_ptr&lt;node_type *&gt;() ;           if ( t-&gt;m_pNext.compare_exchange_strong( tmp, pNew, memory_model::memory_order_release,                     CDS_ATOMIC::memory_order_relaxed ))           {                     break    ;           }           bkoff()    ;      }     ++m_ItemCounter    ;       m_pTail.compare_exchange_strong( t, pNew, memory_model::memory_order_acq_rel,                                                                          CDS_ATOMIC::memory_order_relaxed );       return true ;       }  value_type * dequeue() {      node_type * pNext   ;      back_off bkoff      ;      typename gc::template GuardArray&lt;2&gt;  guards  ;        node_type * h       ;       while ( true ) {            h = guards.protect( 0, m_pHead, node_to_value() )           ;            pNext = guards.protect( 1, h-&gt;m_pNext, node_to_value() )    ;            if ( m_pHead.load(memory_model::memory_order_relaxed) != h )                 continue    ;             if ( pNext == null_ptr&lt;node_type *&gt;() )                  return NULL  ;    \/\/ empty queue             node_type * t = m_pTail.load(memory_model::memory_order_acquire);            if ( h == t ) {                 \/\/ It is needed to help enqueue                m_pTail.compare_exchange_strong( t, pNext, memory_model::memory_order_release,                                                                                    CDS_ATOMIC::memory_order_relaxed ) ;                continue    ;            }             if ( m_pHead.compare_exchange_strong( h, pNext,                       memory_model::memory_order_release, CDS_ATOMIC::memory_order_relaxed ))            {                     break    ;            }            bkoff()    ;      }       --m_ItemCounter          ;       dispose_node( h )   ;      return pNext ; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u0439. \u0422\u043e\u0442 \u0436\u0435 \u043e\u0434\u043d\u043e\u0441\u0432\u044f\u0437\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a, \u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0438 lock-free \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0443\u0436\u0435 \u043a\u043e\u0435 \u043e \u0447\u0451\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442. \u0412 lock-free \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043c\u044b \u0432\u0438\u0434\u0438\u043c:  <\/p>\n<ul>\n<li>\u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u2013 \u043c\u044b \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <code>compare_exchange<\/code>;<\/li>\n<li>\u0437\u0430\u0449\u0438\u0442\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 (<code>guards<\/code>) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e (\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438) \u0432 lock-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 Hazard Pointers;<\/li>\n<li>\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043e\u0432 C++11 \u2013 <code>load, compare_exchange<\/code>, \u0431\u0430\u0440\u044c\u0435\u0440\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 <code>memory_order_xxx<\/code>;<\/li>\n<li>helping \u2014 \u043e\u0447\u0435\u043d\u044c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0435\u043c \u0432 lock-free \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443;<\/li>\n<li>\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 back-off \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 (\u0444\u0443\u043d\u043a\u0442\u043e\u0440 <code>bkoff<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e<\/li>\n<\/ul>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u0438 \u0432\u0435\u0449\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0435 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440\u0430. \u041f\u0443\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0440\u0438\u0433\u0430. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u044d\u0442\u0438 \u0442\u0435\u043c\u044b \u0432 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043a\u0440\u0430\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u043e\u043d\u044f\u0442\u0438\u044e, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u044b \u0432\u0441\u0435 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u2014 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u0438 \u0438 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/497\/ebc\/d54\/497ebcd5463f69256df68eba2ccd58bf.jpeg\" align=\"right\"\/><br \/>  \u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u2013 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043a\u043d\u0438\u0433\u0438 (\u043d\u0435 \u0441\u0442\u0430\u0442\u044c\u0438), \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u0441 \u043c\u043e\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u044b \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a\u043e\u043d\u043a\u0443\u0440\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. <br \/>  \u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0434\u0432\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b:<\/p>\n<p>  1. Nir Shavit, Maurice Herlihy <a href=\"http:\/\/www.amazon.com\/The-Multiprocessor-Programming-Maurice-Herlihy\/dp\/0123705916\">The Art of Multiprocessor programming<\/a>. \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0437\u043d\u0430\u044e, \u043d\u0435\u0442. \u041a\u043d\u0438\u0433\u0430 \u043e\u0447\u0435\u043d\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0432 \u043c\u0438\u0440\u0435 lock-free \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430 Java, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0431 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 C++ (\u0432 Java \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f) \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0432\u0435\u0449\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 Java \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u044b \u0432 \u0441\u0430\u043c \u044f\u0437\u044b\u043a, \u0430 \u0432 C++ \u0432\u0441\u0451 \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e, \u043a\u043d\u0438\u0433\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f.<\/p>\n<p>  2. Anthony Williams <a href=\"http:\/\/www.manning.com\/williams\/\">C++ Concurrency in Action<\/a> (\u0435\u0441\u0442\u044c <a href=\"http:\/\/www.ozon.ru\/context\/detail\/id\/17636939\/\">\u0440\u0443\u0441\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434<\/a>). \u041a\u043d\u0438\u0433\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u0432 \u043c\u0438\u0440\u0435 C++ \u0430\u0432\u0442\u043e\u0440\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c multithread programming \u0438\u043c\u0435\u043d\u043d\u043e \u0432 C++, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 C++11 \u0438 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u041d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:<\/p>\n<p>  [Her90] M. Herlihy, J. M. Wing <a href=\"http:\/\/courses.cs.vt.edu\/~cs5204\/fall07-kafura\/Papers\/TransactionalMemory\/Linearizability.pdf\">Linearizability: A Correctness Condition for Concurrent Objects<\/a>, ACM Transactions on Programming Languages and Systems, 1990<\/p>\n<p>  [Her91] M. Herlihy <a href=\"http:\/\/www.hpl.hp.com\/techreports\/Compaq-DEC\/CRL-91-10.pdf\">A Methodology for Implementing Highly Concurrent Data Object<\/a>, 1991 <\/p>\n<p>  [Mic96] M.Michael, M.Scott <a href=\"http:\/\/www.cs.rochester.edu\/u\/scott\/papers\/1996_PODC_queues.pdf\">Simple, Fast, and Practical Non-Blocking and Blocking Concurrent Queue Algorithms<\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/ifree\/blog\/195770\/\"> http:\/\/habrahabr.ru\/company\/ifree\/blog\/195770\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/164\/b7f\/0d6\/164b7f0d6398bcfaab421f7d957a9acf.jpg\" align=\"right\"\/><br \/>  \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0446\u0438\u043a\u043b\u0430 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043e lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u042f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0445\u0430\u0431\u0440\u0430\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f\u043c \u0438 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u043b\u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 STL \u043a lock-free \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c, \u0438 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 (\u0438 \u0441\u0442\u043e\u0438\u0442 \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435) \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c lock-free \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-195770","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=195770"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195770\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}