{"id":264844,"date":"2015-09-03T21:27:32","date_gmt":"2015-09-03T17:27:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264844"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264844","title":{"rendered":"\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 Arduino \u0438 Linux"},"content":{"rendered":"<p>       \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043a\u0435\u0442\u0447\u0438 Arduino \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043b\u0430\u0442\u0430\u043c\u0438 Intel Galileo \u0438 Intel Edison, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0432 \u043d\u0430\u0431\u043e\u0440 Yocto \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Linux OS. \u0418 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430: \u043a\u0430\u043a \u043d\u0430\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u00ab\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u00bb \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u043c\u0438\u0440\u0430\u043c\u0438. <\/p>\n<p>  <a href=\"http:\/\/geektimes.ru\/company\/intel\/blog\/261350\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6ba\/d90\/0af\/6bad900af68c4625916dd15f77db3be8.jpg\"\/><\/a><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c:<\/p>\n<h2><font color=\"#0071c5\">\u041a\u0440\u0438\u0442\u0435\u0440\u0438\u0438<\/font><\/h2>\n<p>  1. \u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0441\u043a (SD-\u043a\u0430\u0440\u0442\u0430, eMMC) \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0438\u0437\u043d\u043e\u0441\u0430 \u0434\u0438\u0441\u043a\u0430 \u0438 \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.<br \/>  2. \u041a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u043a\u0438\u043c\u0438-\u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441, \u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c \u0438\u043b\u0438 \u0438\u043d\u043e\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u043c\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u043c\u0438).<\/p>\n<h2><font color=\"#0071c5\">\u041c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 (IPC) \u0432 Linux<\/font><\/h2>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0441\u0440\u0435\u0434\u0435 Arduino (\u0441\u043a\u0435\u0442\u0447) \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u043d\u0430 Intel Galileo \u0438\u043b\u0438 Intel Edison, \u2013 \u044d\u0442\u043e Linux-\u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 Linux, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0430\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (IPC) \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 Arduino \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0414\u043b\u044f Linux \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b IPC. \u041e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u2013 \u044d\u0442\u043e \u00ab\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c IPC\u00bb. \u0412 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e IPC-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0434\u0435\u043b\u044f\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043b\u044e\u0431\u044b\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0438\u0434\u0438\u043c\u044b\u043c\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044e: \u0432 \u0445\u043e\u0434\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u043d\u0438 \u043d\u0435 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043a.<\/p>\n<h2><font color=\"#0071c5\">\u041c\u044c\u044e\u0442\u0435\u043a\u0441\u044b \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/font><\/h2>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a:<\/p>\n<p>  <b>1.<\/b> \u041a\u0430\u043a \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f)?<\/p>\n<p>  <b>2.<\/b> \u041a\u0430\u043a \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b) \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435)?<\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043c\u044b \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044d\u0442\u0438 \u0434\u0432\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430. \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u043c\u044c\u044e\u0442\u0435\u043a\u0441\u043e\u0432\u00bb \u0438 \u00ab\u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 POSIX (Pthreads), \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b Linux.<\/p>\n<h2><font color=\"#0071c5\">\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u2013 \u041c\u044c\u044e\u0442\u0435\u043a\u0441<\/font><\/h2>\n<p>  \u0412\u0437\u0430\u0438\u043c\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u043c\u044c\u044e\u0442\u0435\u043a\u0441 (mutex) \u2013 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0439 \u041e\u0421. \u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438 \u0434\u0435\u0442\u0430\u043b\u0438, \u0430 \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u043e\u0432 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 POSIX (Pthreads). \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u0431\u0443\u043c\u0430\u0436\u043d\u044b\u043c \u0438\u0437\u0434\u0430\u043d\u0438\u044f\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Tanenbaum, Woodhull: Operating Systems 3rd ed. Pearson 2006) \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0432 \u0441\u0435\u0442\u0438 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442.<\/p>\n<p>  \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0430\u0431\u043e\u0440 Pthreads \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043d \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u043e\u0449\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u0435 \u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Arduino IDE \u0434\u043b\u044f \u043f\u043b\u0430\u0442 Intel Galileo \u0438 Intel Edison \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Pthreads (\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443) \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044f \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Pthreads \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u043f\u043e\u0442\u043e\u043a. \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0437\u0434\u0435\u0441\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0433 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0443 pthread_mutex_lock \u0432 \u043a\u043e\u0434\u0435. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0441\u043f\u044f\u0449\u0438\u0439 \u0440\u0435\u0436\u0438\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0441\u0430\u043c\u043e\u0439 \u041e\u0421 \u2013 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u043a \u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 pthread_mutex_unlock, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u041e\u0421 \u0440\u0430\u0437\u0431\u0443\u0434\u0438\u0442 \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044f pthread_mutex_lock.<\/p>\n<p>  \u041f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434:<\/p>\n<pre><code>pthread_mutex_lock(&mutex);  \/\/ read \/ write shared memory data here  pthread_mutex_unlock(&mutex);<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043a\u0430\u043a \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0442\u0430\u043a \u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0447\u0442\u0435\u043d\u0438\u044e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 Pthreads, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2><font color=\"#0071c5\">\u0423\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u2013 \u0423\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/font><\/h2>\n<p>  \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0443, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Pthreads \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. \u0423\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0442\u043e\u043a\u0443 \u0438\u043b\u0438 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435) \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0441\u043d\u0443\u0442\u044c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0431\u0443\u0436\u0435\u043d. \u042d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 pthread_cond_wait.<\/p>\n<p>  \u041c\u044c\u044e\u0442\u0435\u043a\u0441 \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0432 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0434\u0430\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434:<\/p>\n<pre><code>pthread_mutex_lock(&mutex); pthread_cond_wait(&cond_variable, &mutex);  \/\/ read shared memory data here  pthread_mutex_unlock(&mutex);<\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u0438 \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0432\u044b\u0437\u043e\u0432 pthread_cond_signal. \u042d\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0437 \u0441\u043f\u044f\u0449\u0435\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430.<\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u0434\u0430\u043d\u0438\u044f\u0445 \u0438\u043b\u0438 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d-\u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<h2><font color=\"#0071c5\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/font><\/h2>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\u0418 \u0434\u043b\u044f \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0430, \u0438 \u0434\u043b\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435.\n<\/li>\n<li>\u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 IPC \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a Arduino IDE \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 IPC. \u041f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u0443\u044e \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Yocto Linux, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Edison, \u0440\u0430\u0432\u043d\u043e \u043a\u0430\u043a \u0438 \u0441 \u043e\u0431\u0440\u0430\u0437\u043e\u043c Yocto \u0434\u043b\u044f SD-\u043a\u0430\u0440\u0442\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \/tmp, \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 tmpfs, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u044e\u0431\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435. \u041c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0444\u0430\u0439\u043b \/tmp\/arduino, \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 IP\u0421.\n<\/li>\n<li>\u041c\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Arduino \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435.\n<\/li>\n<li>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 Arduino \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 Linux \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.\n<\/li>\n<li>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043c\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0434\u0432\u0435 \u0431\u0443\u043b\u0435\u0432\u044b (\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435) \u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u0443\u044e \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 <em>mmapData<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 (\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043d\u0430 IO 8):\n<pre><code>bool led8_on;   \/\/ led on IO8 bool led13_on;  \/\/ built-in led<\/code><\/pre>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 <em>mmapData<\/em> \u2013 \u044d\u0442\u043e \u043c\u044c\u044e\u0442\u0435\u043a\u0441 \u0438 \u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h2><font color=\"#0071c5\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/font><\/h2>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0438\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e MIT License. \u041d\u0438\u0436\u0435 \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<ul>\n<li><b>mmap.ino<\/b>: \u0441\u043a\u0435\u0442\u0447 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0441\u0440\u0435\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 Arduino IDE  <\/li>\n<li><b>mmap.cpp<\/b>: \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0439 \u0437\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445  <\/li>\n<li><b>mmap.h<\/b>: \u0444\u0430\u0439\u043b \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u2013 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Arduino IDE, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 Linux  <\/li>\n<\/ul>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 Arduino \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0430\u043f\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b\u044b mmap.ino \u0438 mmap.h \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043a\u0435\u0442\u0447\u0435\u0439 Arduino. \u0412 Linux \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0444\u0430\u0439\u043b\u044b mmap.cpp \u0438 mmap.\u0440.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043a\u0435\u0442\u0447, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 mmap \u0432 \u0441\u0440\u0435\u0434\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Arduino IDE \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0435\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043f\u043b\u0430\u0442\u0443 (Intel Galileo Gen 1, Intel Galileo Gen 2 \u0438\u043b\u0438 Intel Edison). \u041f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 <a href=\"https:\/\/software.intel.com\/iot\">Intel IoT<\/a> \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 Yocto, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442\u0435 \u0441 Intel Edison, \u0440\u0430\u0432\u043d\u043e \u043a\u0430\u043a \u0441 \u043e\u0431\u0440\u0430\u0437\u043e\u043c Yocto \u0434\u043b\u044f SD-\u043a\u0430\u0440\u0442\u044b, \u0438\u043b\u0438 \u0436\u0435 \u0441 \u043f\u043b\u0430\u0442\u043e\u0439 Intel Galileo, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u0421++. \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code>g++  mmap.cpp   -lpthread -o mmap<\/code><\/pre>\n<p>  \u0412 \u043f\u0430\u043f\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b mmap.cpp \u0438 mmap.h. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>.\/mmap {0,1}{0,1}<\/code><\/pre>\n<p>  \u2026\u0433\u0434\u0435 \u00ab{0,1}\u00bb \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0434\u043b\u044f 0 \u0438\u043b\u0438 1. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u00ab.\/mmap 00\u00bb \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442 \u043e\u0431\u0430 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 .\/mmap 00 \u0438\u0445 \u0432\u043a\u043b\u044e\u0447\u0438\u0442. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u043e\u043d\u0438\u0442\u043e\u0440 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 (Ctrl + Shift + M). <\/p>\n<h2><font color=\"#0071c5\">mmap.ino<\/font><\/h2>\n<p>  <\/p>\n<pre><code>\/*  * Author: Matthias Hahn &lt;matthias.hahn@intel.com&gt;  * Copyright (C) 2014 Intel Corporation  * This file is part of mmap IPC sample provided under the MIT license  *  * Permission is hereby granted, free of charge, to any person obtaining a copy  * of this software and associated documentation files (the &quot;Software&quot;), to deal  * in the Software without restriction, including without limitation the rights  * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell  * copies of the Software, and to permit persons to whom the Software is  * furnished to do so, subject to the following conditions:   * The above copyright notice and this permission notice shall be included in  * all copies or substantial portions of the Software.   * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  * THE SOFTWARE.  *\/  #include &quot;mmap.h&quot;  using namespace std;  \/* assume \/tmp mounted on \/tmpfs -&gt; all operation in memory *\/ \/* we can use just any file in tmpfs. assert(file size not modified && file permissions left readable) *\/ struct mmapData* p_mmapData; \/\/ here our mmapped data will be accessed  int led8 = 8; int led13 = 13;   void exitError(const char* errMsg) {   \/* print to the serial Arduino is attached to, i.e. \/dev\/ttyGS0 *\/   string s_cmd(&quot;echo 'error: &quot;);   s_cmd = s_cmd + errMsg + &quot; - exiting' &gt; \/dev\/ttyGS0&quot;;   system(s_cmd.c_str());    exit(EXIT_FAILURE); }    void setup() {   int fd_mmapFile; \/\/ file descriptor for memory mapped file   \/* open file and mmap mmapData*\/   fd_mmapFile = open(mmapFilePath, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);   if (fd_mmapFile == -1) exitError(&quot;couldn't open mmap file&quot;);    \/* make the file the right size - exit if this fails*\/   if (ftruncate(fd_mmapFile, sizeof(struct mmapData)) == -1) exitError(&quot;couldn' modify mmap file&quot;);   \/* memory map the file to the data *\/   \/* assert(filesize not modified during execution) *\/   p_mmapData = static_cast&lt;struct mmapData*&gt;(mmap(NULL, sizeof(struct mmapData), PROT_READ | PROT_WRITE, MAP_SHARED, fd_mmapFile, 0));     if (p_mmapData == MAP_FAILED) exitError(&quot;couldn't mmap&quot;);    \/* initialize mutex *\/   pthread_mutexattr_t mutexattr;    if (pthread_mutexattr_init(&mutexattr) == -1) exitError(&quot;pthread_mutexattr_init&quot;);   if (pthread_mutexattr_setrobust(&mutexattr, PTHREAD_MUTEX_ROBUST) == -1) exitError(&quot;pthread_mutexattr_setrobust&quot;);   if (pthread_mutexattr_setpshared(&mutexattr, PTHREAD_PROCESS_SHARED) == -1) exitError(&quot;pthread_mutexattr_setpshared&quot;);   if (pthread_mutex_init(&(p_mmapData-&gt;mutex), &mutexattr) == -1) exitError(&quot;pthread_mutex_init&quot;);    \/* initialize condition variable *\/   pthread_condattr_t condattr;   if (pthread_condattr_init(&condattr) == -1) exitError(&quot;pthread_condattr_init&quot;);   if (pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED) == -1) exitError(&quot;pthread_condattr_setpshared&quot;);   if (pthread_cond_init(&(p_mmapData-&gt;cond), &condattr) == -1) exitError(&quot;pthread_mutex_init&quot;);    \/* for this test we just use 2 LEDs *\/   pinMode(led8, OUTPUT);   pinMode(led13, OUTPUT); }  void loop() {   \/* block until we are signalled from native code *\/   if (pthread_mutex_lock(&(p_mmapData-&gt;mutex)) != 0) exitError(&quot;pthread_mutex_lock&quot;);   if (pthread_cond_wait(&(p_mmapData-&gt;cond), &(p_mmapData-&gt;mutex)) != 0) exitError(&quot;pthread_cond_wait&quot;);    if (p_mmapData-&gt;led8_on) {     system(&quot;echo 8:1 &gt; \/dev\/ttyGS0&quot;);     digitalWrite(led8, HIGH);   }   else {     system(&quot;echo 8:0 &gt; \/dev\/ttyGS0&quot;);     digitalWrite(led8, LOW);   }     if (p_mmapData-&gt;led13_on) {     system(&quot;echo 13:1 &gt; \/dev\/ttyGS0&quot;);     digitalWrite(led13, HIGH);   }   else {     system(&quot;echo 13:0 &gt; \/dev\/ttyGS0&quot;);     digitalWrite(led13, LOW);   }     if (pthread_mutex_unlock(&(p_mmapData-&gt;mutex)) != 0) exitError(&quot;pthread_mutex_unlock&quot;); }<\/code><\/pre>\n<h2><font color=\"#0071c5\">mmap.cpp<\/font><\/h2>\n<p>  <\/p>\n<pre><code>\/*  * Author: Matthias Hahn &lt;matthias.hahn@intel.com&gt;  * Copyright (C) 2014 Intel Corporation  * This file is part of mmap IPC sample provided under the MIT license  *  * Permission is hereby granted, free of charge, to any person obtaining a copy  * of this software and associated documentation files (the &quot;Software&quot;), to deal  * in the Software without restriction, including without limitation the rights  * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell  * copies of the Software, and to permit persons to whom the Software is  * furnished to do so, subject to the following conditions:   * The above copyright notice and this permission notice shall be included in  * all copies or substantial portions of the Software.   * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  * THE SOFTWARE.  *\/  \/* mmap.cpp    Linux native program communicating via memory mapped data with Arduino sketch.    Compilation: g++  mmap.cpp   -lpthread -o mmap    Run: .\/mmap &lt;LED8&gt;&lt;LED13&gt; (e.g. .\/mmap 01 -&gt; LED 8 off, LED 13 on)    For &quot;random&quot; blink you may run following commands in the command line:    while [ 1 ]; do .\/mmap $(($RANDOM % 2))$(($RANDOM % 2)); done *\/  #include &quot;mmap.h&quot;  void exitError(const char* errMsg) {   perror(errMsg);   exit(EXIT_FAILURE); }   using namespace std;   \/**  * @brief: for this example uses a binary string &quot;&lt;led8&gt;&lt;led13&gt;&quot;; e.g. &quot;11&quot;: both leds on  * if no arg equals &quot;00&quot;   * For &quot;random&quot; blink you may run following commands in the command line:  * while [ 1 ]; do .\/mmap $(($RANDOM % 2))$(($RANDOM % 2)); done  *\/ int main(int argc, char** argv) {   struct mmapData* p_mmapData; \/\/ here our mmapped data will be accessed   int fd_mmapFile; \/\/ file descriptor for memory mapped file    \/* Create shared memory object and set its size *\/   fd_mmapFile = open(mmapFilePath, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);   if (fd_mmapFile == -1) exitError(&quot;fd error; check errno for details&quot;);      \/* Map shared memory object read-writable *\/   p_mmapData = static_cast&lt;struct mmapData*&gt;(mmap(NULL, sizeof(struct mmapData), PROT_READ | PROT_WRITE, MAP_SHARED, fd_mmapFile, 0));   if (p_mmapData == MAP_FAILED) exitError(&quot;mmap error&quot;);   \/* the Arduino sketch might still be reading - by locking this program will be blocked until the mutex is unlocked from the reading sketch     * in order to prevent race conditions *\/   if (pthread_mutex_lock(&(p_mmapData-&gt;mutex)) != 0) exitError(&quot;pthread_mutex_lock&quot;);   if (argc == 1) {      cout &lt;&lt; &quot;8:0&quot; &lt;&lt; endl;     cout &lt;&lt; &quot;13:0&quot; &lt;&lt; endl;     p_mmapData-&gt;led8_on = false;     p_mmapData-&gt;led13_on = false;   }   else if (argc &gt; 1) {     \/\/ assert(correct string given)     int binNr = atol(argv[1]);     if (binNr &gt;= 10) {       cout &lt;&lt; &quot;8:1&quot; &lt;&lt; endl;       p_mmapData-&gt;led8_on = true;      }     else {       cout &lt;&lt; &quot;8:0&quot; &lt;&lt; endl;       p_mmapData-&gt;led8_on = false;     }     binNr %= 10;     if (binNr == 1) {       cout &lt;&lt; &quot;13:1&quot; &lt;&lt; endl;       p_mmapData-&gt;led13_on = true;      }     else {       cout &lt;&lt; &quot;13:0&quot; &lt;&lt; endl;       p_mmapData-&gt;led13_on = false;     }   }   \/\/ signal to waiting thread   if (pthread_mutex_unlock(&(p_mmapData-&gt;mutex)) != 0) exitError(&quot;pthread_mutex_unlock&quot;);   if (pthread_cond_signal(&(p_mmapData-&gt;cond)) != 0) exitError(&quot;pthread_cond_signal&quot;); }<\/code><\/pre>\n<h2><font color=\"#0071c5\">mmap.h<\/font><\/h2>\n<p>  <\/p>\n<pre><code>\/*  * Author: Matthias Hahn &lt;matthias.hahn@intel.com&gt;  * Copyright (C) 2014 Intel Corporation  * This file is part of mmap IPC sample provided under the MIT license  *  * Permission is hereby granted, free of charge, to any person obtaining a copy  * of this software and associated documentation files (the &quot;Software&quot;), to deal  * in the Software without restriction, including without limitation the rights  * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell  * copies of the Software, and to permit persons to whom the Software is  * furnished to do so, subject to the following conditions:   * The above copyright notice and this permission notice shall be included in  * all copies or substantial portions of the Software.   * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN  * THE SOFTWARE.  *\/  #ifndef MMAP_HPP #define MMAP_HPP  #include &lt;fcntl.h&gt; #include &lt;unistd.h&gt; #include &lt;sys\/mman.h&gt; #include &lt;iostream&gt; #include &lt;string.h&gt; #include &lt;stdlib.h&gt; #include &lt;cstdio&gt; #include &lt;pthread.h&gt;  \/* assert(\/tmp mounted to tmpfs, i.e. resides in RAM) *\/ \/* just use any file in \/tmp *\/ static const char* mmapFilePath = &quot;\/tmp\/arduino&quot;;   struct mmapData {   bool led8_on;   \/\/ led on IO8   bool led13_on;  \/\/ built-in led   pthread_mutex_t mutex;   pthread_cond_t cond; };  #endif<\/code><\/pre>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!   \t<\/p>\n<div class=\"clear\"><\/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:\/\/geektimes.ru\/post\/261350\/\"> http:\/\/geektimes.ru\/post\/261350\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043a\u0435\u0442\u0447\u0438 Arduino \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u043b\u0430\u0442\u0430\u043c\u0438 Intel Galileo \u0438 Intel Edison, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0432 \u043d\u0430\u0431\u043e\u0440 Yocto \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Linux OS. \u0418 \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b\u0438 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0430: \u043a\u0430\u043a \u043d\u0430\u043b\u0430\u0434\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u00ab\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u00bb \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0434\u0432\u0443\u043c\u044f \u043c\u0438\u0440\u0430\u043c\u0438. <\/p>\n<p>  <a href=\"http:\/\/geektimes.ru\/company\/intel\/blog\/261350\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6ba\/d90\/0af\/6bad900af68c4625916dd15f77db3be8.jpg\"\/><\/a>  <\/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-264844","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264844","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=264844"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264844\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}