{"id":17946,"date":"2017-05-10T13:59:41","date_gmt":"2017-05-10T17:59:41","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=17946"},"modified":"2017-05-15T14:09:53","modified_gmt":"2017-05-15T18:09:53","slug":"sierra-bluetooth-problems-due-to-gcd","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/05\/10\/sierra-bluetooth-problems-due-to-gcd\/","title":{"rendered":"Sierra Bluetooth Problems Due to GCD?"},"content":{"rendered":"<p><a href=\"https:\/\/eclecticlight.co\/2017\/05\/09\/hasnt-macos-changed-how-it-doesnt-work-like-it-used-to\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2017\/05\/09\/hasnt-macos-changed-how-it-doesnt-work-like-it-used-to\/\">\n<p>One of the well-known problems in multi-tasking and concurrency is deadlock, when one task sits waiting for another, and the other task cannot proceed until the first task is complete. GCD is not immune from deadlock, and there are some curious issues which have arisen in El Capitan and Sierra which look suspiciously as if deadlock may have been their root cause.<\/p>\n<p>I am also beginning to wonder if some of the persistent problems which we have experienced with Bluetooth disconnects, in both El Capitan and Sierra, are the result of issues within GCD, rather than in the Bluetooth drivers themselves. Even now, with Sierra 10.12.4, seldom a day passes without my Magic Trackpad 2 spontaneously disconnecting, then reconnecting.<\/p>\n<p>These are all made the more complex by GCD&rsquo;s heuristics, its &lsquo;smart&rsquo; dispatching system. When trying to identify and diagnose problems, predictability is one of the most important properties, but because of those complex heuristics nothing about GCD follows clear and simple rules.<\/p>\n<\/blockquote>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2017\/03\/08\/sierra-bluetooth-problems-and-the-logitech-k811-keyboard\/\">Sierra Bluetooth Problems and the Logitech K811 Keyboard<\/a>.<\/p>\n\n<p>Update (2017-05-15): <a href=\"https:\/\/eclecticlight.co\/2017\/05\/15\/how-macos-runs-background-activities-3-when-things-go-wrong\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2017\/05\/15\/how-macos-runs-background-activities-3-when-things-go-wrong\/\">\n<p><code>libdispatch<\/code> (&lsquo;old&rsquo; GCD) provides facilities which include the management and dispatch of code threads or Operation Objects, which can be distributed optimally across the processor cores available in a Mac. In particular it manages multiple dispatch queues.<\/p>\n<p>Centralized Task Scheduling (CTS) allows a developer to assign criteria for when a task should be performed, so that scheduled and other tasks can be deferred when necessary, for example when a laptop is running from its battery rather than mains power.<\/p>\n<p>I hope that I have shown that Duet Activity Scheduler (DAS) manages heuristically a pool or queue of tasks or activities, and determines when to dispatch them for execution.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Howard Oakley: One of the well-known problems in multi-tasking and concurrency is deadlock, when one task sits waiting for another, and the other task cannot proceed until the first task is complete. GCD is not immune from deadlock, and there are some curious issues which have arisen in El Capitan and Sierra which look suspiciously [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[422,131,800,880,30,1381],"class_list":["post-17946","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bluetooth","tag-bug","tag-concurrency","tag-grand-central-dispatch-gcd","tag-mac","tag-macos-10-12"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=17946"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17946\/revisions"}],"predecessor-version":[{"id":17985,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17946\/revisions\/17985"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=17946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=17946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=17946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}