{"id":3459,"date":"2019-04-24T08:53:00","date_gmt":"2019-04-24T08:53:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/mom-he-blocked-threads-again\/"},"modified":"2026-04-24T11:21:40","modified_gmt":"2026-04-24T11:21:40","slug":"maminka-opet-zablokoval-vlakna","status":"publish","type":"post","link":"https:\/\/thecodest.co\/cs\/blog\/mom-he-blocked-threads-again\/","title":{"rendered":"MAMINKA! Zase zablokoval vl\u00e1kna!"},"content":{"rendered":"<h2>Vl\u00e1kna<\/h2>\n<p>Hlavn\u00ed v\u011bc, kterou je t\u0159eba si zapamatovat: existuj\u00ed dva typy vl\u00e1ken v. <strong><a href=\"https:\/\/thecodest.co\/cs\/blog\/find-your-node-js-expert-for-hire-today\/\">Node.js<\/a><\/strong>: Hlavn\u00ed vl\u00e1kno - o kter\u00e9 se star\u00e1 <b>Smy\u010dka ud\u00e1lost\u00ed<\/b>a <b>Baz\u00e9n pracovn\u00edk\u016f<\/b> (thread pool) - co\u017e je fond vl\u00e1ken -<br \/>\n<a href=\"http:\/\/docs.libuv.org\/en\/v1.x\/threadpool.html\" rel=\"nofollow\">d\u00edky libuv<\/a>. Ka\u017ed\u00fd z nich m\u00e1 jinou pr\u00e1ci. \u00dakolem prvn\u00edho z nich je zpracov\u00e1vat neblokovan\u00e9 I\/O operace a druh\u00fd je zodpov\u011bdn\u00fd za pr\u00e1ci n\u00e1ro\u010dnou na procesor a tak\u00e9 za blokov\u00e1n\u00ed I\/O operac\u00ed.<\/p>\n<p><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/libuv.png\" alt=\"diagram libuv\" title=\"sou\u010d\u00e1sti syst\u00e9mu libuv\" \/><\/p>\n<p>Co je to ale vl\u00e1kno a v \u010dem se li\u0161\u00ed od procesu? Rozd\u00edl\u016f je n\u011bkolik, ale nejd\u016fle\u017eit\u011bj\u0161\u00ed je, \u017ee se li\u0161\u00ed <a href=\"https:\/\/thecodest.co\/cs\/blog\/why-us-companies-are-opting-for-polish-developers\/\">n\u00e1s<\/a> je zp\u016fsob, jak\u00fdm je jim p\u0159id\u011blov\u00e1na pam\u011b\u0165. O procesu m\u016f\u017eete uva\u017eovat jako o aplikaci. Uvnit\u0159 ka\u017ed\u00e9ho procesu je kus pam\u011bti vyhrazen\u00fd pr\u00e1v\u011b pro tento proces. Jeden proces tedy nem\u00e1 p\u0159\u00edstup do pam\u011bti druh\u00e9ho procesu a tato vlastnost zaji\u0161\u0165uje vysokou bezpe\u010dnost. Abychom mezi nimi mohli nav\u00e1zat komunikaci, mus\u00edme ud\u011blat ur\u010ditou pr\u00e1ci. Vl\u00e1kna se li\u0161\u00ed. Vl\u00e1kna b\u011b\u017e\u00ed uvnit\u0159 procesu a sd\u00edlej\u00ed stejnou pam\u011b\u0165, tak\u017ee nen\u00ed v\u016fbec \u017e\u00e1dn\u00fd probl\u00e9m s t\u00edm, \u017ee by vl\u00e1kna sd\u00edlela pam\u011b\u0165 <a href=\"https:\/\/thecodest.co\/cs\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a>.<\/p>\n<p>Jeden probl\u00e9m v\u0161ak zp\u016fsobuje probl\u00e9m. \u0158\u00edk\u00e1 se mu race condition. Vl\u00e1kna mohou b\u011b\u017eet sou\u010dasn\u011b, jak tedy pozn\u00e1me, kter\u00e9 skon\u010d\u00ed d\u0159\u00edve? M\u016f\u017ee se st\u00e1t, \u017ee p\u0159i prvn\u00edm spu\u0161t\u011bn\u00ed skon\u010d\u00ed prvn\u00ed operace jako prvn\u00ed a p\u0159\u00ed\u0161t\u011b to m\u016f\u017ee dopadnout naopak a druh\u00e1 operace skon\u010d\u00ed d\u0159\u00edve ne\u017e prvn\u00ed. P\u0159edstavte si pr\u00e1ci s operacemi z\u00e1pisu\/\u010dten\u00ed za takov\u00fdch podm\u00ednek! No\u010dn\u00ed m\u016fra! N\u011bkdy je velmi t\u011b\u017ek\u00e9 napsat spr\u00e1vn\u00fd <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/what-is-code-refactoring\/\">k\u00f3d<\/a> ve v\u00edcevl\u00e1knov\u00e9m prost\u0159ed\u00ed.<\/p>\n<p>V\u00edcevl\u00e1knov\u00e9 jazyky maj\u00ed tak\u00e9 velkou pam\u011b\u0165ovou re\u017eii, proto\u017ee pro ka\u017ed\u00fd po\u017eadavek vytv\u00e1\u0159ej\u00ed samostatn\u00e9 vl\u00e1kno; pokud tedy chcete zavolat 1000 po\u017eadavk\u016f, vytvo\u0159\u00ed 1000 vl\u00e1ken.<\/p>\n<p>Jak se s takov\u00fdm probl\u00e9mem vypo\u0159\u00e1dat? Pou\u017eijte rad\u011bji jedno vl\u00e1kno! A to je to, co <strong><a href=\"https:\/\/thecodest.co\/cs\/dictionary\/what-is-node-js-used-for\/\">Uzel<\/a><\/strong> v\u00e1m nab\u00edz\u00ed.<\/p>\n<p><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/eventloop.png\" alt=\"jedno vl\u00e1kno eventloop\" title=\"diagram smy\u010dky ud\u00e1lost\u00ed \" \/><\/p>\n<p>Jako <strong><a href=\"https:\/\/thecodest.co\/cs\/blog\/hire-javascript-developer\/\">V\u00fdvoj\u00e1\u0159 JavaScript<\/a><\/strong> Doporu\u010duji v\u00e1m sledovat <a href=\"https:\/\/youtu.be\/PNa9OMajw9w\" rel=\"nofollow\">film<\/a><br \/>\nve kter\u00e9m Bart Belder jasn\u011b vysv\u011btluje koncept smy\u010dky ud\u00e1lost\u00ed. V\u00fd\u0161e uveden\u00fd diagram je p\u0159evzat z jeho prezentace. A pokud tyto pojmy v\u016fbec nezn\u00e1te, oba <strong>Uzel<\/strong> a Libuv maj\u00ed vynikaj\u00edc\u00ed dokumentaci \ud83d\ude42<\/p>\n<h2>O blokov\u00e1n\u00ed<\/h2>\n<p>Na adrese <strong><a href=\"https:\/\/thecodest.co\/cs\/dictionary\/why-is-javascript-so-popular\/\">JavaScript<\/a> v\u00fdvoj<\/strong> pr\u016fmyslu \u0159\u00edkaj\u00ed, \u017ee proto. <strong>Uzel<\/strong> je jednovl\u00e1knov\u00fd a neblokuje se, m\u016f\u017eete dos\u00e1hnout vy\u0161\u0161\u00ed soub\u011b\u017enosti se stejn\u00fdmi prost\u0159edky ne\u017e u v\u00edcevl\u00e1knov\u00fdch \u0159e\u0161en\u00ed. Je to pravda, ale nen\u00ed to tak kr\u00e1sn\u00e9 a snadn\u00e9, jak se m\u016f\u017ee zd\u00e1t.<\/p>\n<p>Vzhledem k tomu, \u017ee <strong>Node.js<\/strong> je jednovl\u00e1knov\u00fd (<a href=\"https:\/\/thecodest.co\/cs\/blog\/hire-vue-js-developers\/\">JS<\/a> \u010d\u00e1st), \u00falohy n\u00e1ro\u010dn\u00e9 na procesor zablokuj\u00ed v\u0161echny prob\u00edhaj\u00edc\u00ed po\u017eadavky, dokud nebude dan\u00e1 \u00faloha dokon\u010dena. Je tedy pravda, \u017ee v <strong>Node.js<\/strong> m\u016f\u017eete zablokovat ka\u017ed\u00fd po\u017eadavek jen proto, \u017ee jeden z nich obsahoval bloka\u010dn\u00ed instrukci. Blokuj\u00edc\u00ed k\u00f3d znamen\u00e1, \u017ee jeho dokon\u010den\u00ed trv\u00e1 d\u00e9le ne\u017e n\u011bkolik milisekund. Neple\u0165te si v\u0161ak dlouhou dobu odezvy s blokov\u00e1n\u00edm. Odpov\u011b\u010f z datab\u00e1ze m\u016f\u017ee trvat velmi dlouho, ale neblokuje v\u00e1\u0161 proces (aplikaci).<\/p>\n<p>Blokovac\u00ed metody se prov\u00e1d\u011bj\u00ed synchronn\u011b a neblokuj\u00edc\u00ed metody se prov\u00e1d\u011bj\u00ed asynchronn\u011b.<\/p>\n<p>Jak m\u016f\u017eete zpomalit (nebo zablokovat) smy\u010dku ud\u00e1lost\u00ed?<\/p>\n<ul>\n<li>zraniteln\u00fd regex - zraniteln\u00fd regul\u00e1rn\u00ed v\u00fdraz je takov\u00fd, na kter\u00e9m m\u016f\u017ee v\u00e1\u0161 regul\u00e1rn\u00ed v\u00fdrazov\u00fd engine zab\u00edrat exponenci\u00e1ln\u00ed \u010das; m\u016f\u017eete si o nich p\u0159e\u010d\u00edst v\u00edce.  <a href=\"https:\/\/nodejs.org\/en\/docs\/guides\/dont-block-the-event-loop\/\" rel=\"nofollow\">zde<\/a>,<\/li>\n<li>Operace JSON s velk\u00fdmi objekty,<\/li>\n<li>pomoc\u00ed synchronn\u00edch rozhran\u00ed API z <strong>Uzel <\/strong>m\u00edsto asynchronn\u00edch verz\u00ed; v\u0161echny I\/O metody ve standardn\u00ed knihovn\u011b Node.js poskytuj\u00ed tak\u00e9 sv\u00e9 asynchronn\u00ed verze,<\/li>\n<li>dal\u0161\u00ed program\u00e1torsk\u00e9 chyby, jako jsou synchronn\u00ed nekone\u010dn\u00e9 smy\u010dky.<\/li>\n<\/ul>\n<p>Je v takov\u00e9m p\u0159\u00edpad\u011b mo\u017en\u00e9 blokovat i tato vl\u00e1kna, proto\u017ee Worker Pool vyu\u017e\u00edv\u00e1 pool vl\u00e1ken? Bohu\u017eel ano \ud83d\ude41<strong> Uzel<\/strong> je zalo\u017eena na filozofii <code>jedno vl\u00e1kno pro mnoho klient\u016f.<\/code> P\u0159edpokl\u00e1dejme, \u017ee dan\u00fd \u00fakol prov\u00e1d\u011bn\u00fd konkr\u00e9tn\u00edm pracovn\u00edkem je velmi slo\u017eit\u00fd a pot\u0159ebuje k dokon\u010den\u00ed v\u00edce \u010dasu. V d\u016fsledku toho je Worker zablokov\u00e1n a nelze jej pou\u017e\u00edt k proveden\u00ed \u017e\u00e1dn\u00e9 jin\u00e9 \u010dekaj\u00edc\u00ed \u00falohy, dokud nebudou jeho pokyny provedeny. Jak jste ji\u017e pravd\u011bpodobn\u011b uhodli, m\u016f\u017ee to m\u00edt vliv na v\u00fdkon. T\u011bmto probl\u00e9m\u016fm m\u016f\u017eete p\u0159edej\u00edt minimalizac\u00ed rozd\u00edl\u016f v \u010dasech \u00faloh pomoc\u00ed rozd\u011blen\u00ed \u00faloh.<\/p>\n<h2>Z\u00e1v\u011br<\/h2>\n<p>Ur\u010dit\u011b se vyhn\u011bte blokov\u00e1n\u00ed. Pokud m\u016f\u017eete, v\u017edy volte asynchronn\u00ed verze standardn\u00edch knihovn\u00edch rozhran\u00ed API. V opa\u010dn\u00e9m p\u0159\u00edpad\u011b m\u016f\u017ee klient po spu\u0161t\u011bn\u00ed va\u0161\u00ed aplikace zaznamenat n\u011bkolik probl\u00e9m\u016f, po\u010d\u00ednaje sn\u00ed\u017eenou propustnost\u00ed a kon\u010de \u00fapln\u00fdm odstoupen\u00edm, co\u017e je z pohledu u\u017eivatele fat\u00e1ln\u00ed.<\/p>\n<p><article-inline-code-review><\/article-inline-code-review><\/p>\n<p><b>P\u0159e\u010dt\u011bte si v\u00edce:<\/b><\/p>\n<p><a href=\"https:\/\/thecodest.co\/blog\/why-you-should-probably-use-typescript\">Pro\u010d byste (pravd\u011bpodobn\u011b) m\u011bli pou\u017e\u00edvat Typescript<\/a><\/p>\n<p><a href=\"https:\/\/thecodest.co\/blog\/how-not-to-kill-a-project-with-bad-coding-practices\/\">Jak nezni\u010dit projekt \u0161patn\u00fdmi k\u00f3dovac\u00edmi postupy?<\/a><\/p>\n<p><a href=\"https:\/\/thecodest.co\/blog\/data-fetching-strategies-in-nextjs\/\">Strategie na\u010d\u00edt\u00e1n\u00ed dat v NextJS<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\"Don`t block the event loop...\" - tuto v\u011btu jste pravd\u011bpodobn\u011b sly\u0161eli mnohokr\u00e1t... Nep\u0159ekvapuje m\u011b to, proto\u017ee je to jeden z nejd\u016fle\u017eit\u011bj\u0161\u00edch p\u0159edpoklad\u016f p\u0159i pr\u00e1ci s Node. Existuje v\u0161ak i druh\u00e1 \"v\u011bc\", kterou byste nem\u011bli blokovat - Worker Pool. Pokud ho zanedb\u00e1te, m\u016f\u017ee m\u00edt v\u00fdrazn\u00fd dopad na v\u00fdkon aplikace a dokonce i na jej\u00ed bezpe\u010dnost.<\/p>","protected":false},"author":2,"featured_media":3460,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>MOM! He Blocked Threads Again! - The Codest<\/title>\n<meta name=\"description\" content=\"\u201cDon`t block the event loop\u2026\u201d \u2013 you&#039;ve probably heard this sentence many times\u2026 I&#039;m not surprised because it is one of the most important assumptions when working with Node. But there is also a second \u201cthing\u201d which you should refrain from blocking \u2013 the Worker Pool. If neglected, it can have a significant impact on application performance and even its security.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/cs\/blog\/maminka-opet-zablokoval-vlakna\/\" \/>\n<meta property=\"og:locale\" content=\"cs_CZ\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MOM! He Blocked Threads Again!\" \/>\n<meta property=\"og:description\" content=\"\u201cDon`t block the event loop\u2026\u201d \u2013 you&#039;ve probably heard this sentence many times\u2026 I&#039;m not surprised because it is one of the most important assumptions when working with Node. But there is also a second \u201cthing\u201d which you should refrain from blocking \u2013 the Worker Pool. If neglected, it can have a significant impact on application performance and even its security.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/cs\/blog\/maminka-opet-zablokoval-vlakna\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-24T08:53:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-24T11:21:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"MOM! He Blocked Threads Again!\",\"datePublished\":\"2019-04-24T08:53:00+00:00\",\"dateModified\":\"2026-04-24T11:21:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/\"},\"wordCount\":755,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"cs\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/\",\"name\":\"MOM! He Blocked Threads Again! - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg\",\"datePublished\":\"2019-04-24T08:53:00+00:00\",\"dateModified\":\"2026-04-24T11:21:40+00:00\",\"description\":\"\u201cDon`t block the event loop\u2026\u201d \u2013 you've probably heard this sentence many times\u2026 I'm not surprised because it is one of the most important assumptions when working with Node. But there is also a second \u201cthing\u201d which you should refrain from blocking \u2013 the Worker Pool. If neglected, it can have a significant impact on application performance and even its security.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#breadcrumb\"},\"inLanguage\":\"cs\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/mom-he-blocked-threads-again\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MOM! He Blocked Threads Again!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"cs\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/cs\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MAMINKA! Zase zablokoval vl\u00e1kna! - The Codest","description":"\"Don`t block the event loop...\" - tuto v\u011btu jste pravd\u011bpodobn\u011b sly\u0161eli mnohokr\u00e1t... Nep\u0159ekvapuje m\u011b to, proto\u017ee je to jeden z nejd\u016fle\u017eit\u011bj\u0161\u00edch p\u0159edpoklad\u016f p\u0159i pr\u00e1ci s Node. Existuje v\u0161ak i druh\u00e1 \"v\u011bc\", kterou byste nem\u011bli blokovat - Worker Pool. Pokud ho zanedb\u00e1te, m\u016f\u017ee m\u00edt v\u00fdrazn\u00fd dopad na v\u00fdkon aplikace a dokonce i na jej\u00ed bezpe\u010dnost.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/cs\/blog\/maminka-opet-zablokoval-vlakna\/","og_locale":"cs_CZ","og_type":"article","og_title":"MOM! He Blocked Threads Again!","og_description":"\u201cDon`t block the event loop\u2026\u201d \u2013 you've probably heard this sentence many times\u2026 I'm not surprised because it is one of the most important assumptions when working with Node. But there is also a second \u201cthing\u201d which you should refrain from blocking \u2013 the Worker Pool. If neglected, it can have a significant impact on application performance and even its security.","og_url":"https:\/\/thecodest.co\/cs\/blog\/maminka-opet-zablokoval-vlakna\/","og_site_name":"The Codest","article_published_time":"2019-04-24T08:53:00+00:00","article_modified_time":"2026-04-24T11:21:40+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg","type":"image\/jpeg"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"4 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"MOM! He Blocked Threads Again!","datePublished":"2019-04-24T08:53:00+00:00","dateModified":"2026-04-24T11:21:40+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/"},"wordCount":755,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg","articleSection":["Software Development"],"inLanguage":"cs","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/","url":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/","name":"MAMINKA! Zase zablokoval vl\u00e1kna! - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg","datePublished":"2019-04-24T08:53:00+00:00","dateModified":"2026-04-24T11:21:40+00:00","description":"\"Don`t block the event loop...\" - tuto v\u011btu jste pravd\u011bpodobn\u011b sly\u0161eli mnohokr\u00e1t... Nep\u0159ekvapuje m\u011b to, proto\u017ee je to jeden z nejd\u016fle\u017eit\u011bj\u0161\u00edch p\u0159edpoklad\u016f p\u0159i pr\u00e1ci s Node. Existuje v\u0161ak i druh\u00e1 \"v\u011bc\", kterou byste nem\u011bli blokovat - Worker Pool. Pokud ho zanedb\u00e1te, m\u016f\u017ee m\u00edt v\u00fdrazn\u00fd dopad na v\u00fdkon aplikace a dokonce i na jej\u00ed bezpe\u010dnost.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#breadcrumb"},"inLanguage":"cs","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/"]}]},{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/thecodest_blog_post_coverproduct_design_agency_-5-.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/mom-he-blocked-threads-again\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"MOM! He Blocked Threads Again!"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"cs"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"cs","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/cs\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/comments?post=3459"}],"version-history":[{"count":5,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3459\/revisions"}],"predecessor-version":[{"id":7929,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3459\/revisions\/7929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media\/3460"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media?parent=3459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/categories?post=3459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/tags?post=3459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}