{"id":28753,"date":"2006-12-12T10:00:00","date_gmt":"2006-12-12T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2006\/12\/12\/a-high-waiter-count-on-a-free-critical-section-may-indicate-a-lock-convoy\/"},"modified":"2024-03-20T08:37:17","modified_gmt":"2024-03-20T15:37:17","slug":"20061212-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20061212-00\/?p=28753","title":{"rendered":"A high waiter count on a free critical section may indicate a lock convoy"},"content":{"rendered":"<p>If you&#8217;re debugging a performance problem in your application, you may run across a critical section in a very strange state: A lot of threads are waiting for it, but nobody owns it!<\/p>\n<pre>0:000&gt; !critsec 0x10009C70\r\nCritSec at 0x10009C70\r\nLockCount          37\r\nRecursionCount     0\r\nOwningThread       0\r\n<\/pre>\n<p>This state means that the previous owner of the critical section has just exited it and signalled a waiting thread to take it, but that thread hasn&#8217;t yet gotten a chance to run yet. This is normally a transient condition, but if you see it a lot, then you very likely the victim of a lock convoy.<\/p>\n<p><a title=\"So you need a work thread pool\" href=\"https:\/\/learn.microsoft.com\/en-us\/archive\/blogs\/larryosterman\/so-you-need-a-worker-thread-pool\"> Others<\/a> <a title=\"Lock convoys and how to recognize them\" href=\"https:\/\/learn.microsoft.com\/en-us\/archive\/blogs\/sloh\/lock-convoys-and-how-to-recognize-them\"> have written<\/a> <a href=\"http:\/\/www.serious-code.net\/moin.cgi\/CategoryOptimization?action=AttachFile&amp;do=get&amp;target=satips2.ppt\"> about lock convoys<\/a>, so I&#8217;m just going to refer you to them to get the details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nobody can make any progress because they keep getting stuck.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-28753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Nobody can make any progress because they keep getting stuck.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/28753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=28753"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/28753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=28753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=28753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=28753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}