{"action":"created","issue":{"url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/13","repository_url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source","labels_url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/13/comments","events_url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/13/events","html_url":"https://github.com/micro-os-plus/micro-os-plus.github.io-source/issues/13","id":172200211,"number":13,"title":"The influence on the scheduler in infinite loop threads.","user":{"login":"carlosdelfino","id":369056,"avatar_url":"https://avatars.githubusercontent.com/u/369056?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosdelfino","html_url":"https://github.com/carlosdelfino","followers_url":"https://api.github.com/users/carlosdelfino/followers","following_url":"https://api.github.com/users/carlosdelfino/following{/other_user}","gists_url":"https://api.github.com/users/carlosdelfino/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosdelfino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosdelfino/subscriptions","organizations_url":"https://api.github.com/users/carlosdelfino/orgs","repos_url":"https://api.github.com/users/carlosdelfino/repos","events_url":"https://api.github.com/users/carlosdelfino/events{/privacy}","received_events_url":"https://api.github.com/users/carlosdelfino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-19T19:11:43Z","updated_at":"2016-08-20T18:39:03Z","closed_at":null,"body":"Translating the subtitle \"Infinite loop threads\" in [threads.md](https://github.com/micro-os-plus/micro-os-plus.github.io-source/blob/master/pages/user-manual/threads.md) file, the influence of this type of scheduler threads or the thread consuming more time that the scheduler determines each to use the CPU, I came up with the following question.\r\n\r\nAccording to the text,\r\n\r\n> The infinite loop must call a µOS++ service that will cause the thread to pass control back to the scheduler, for example a service to wait for an event to occur, or sleep for a certain duration. It is important that each thread will pass control back to the scheduler, otherwise the thread would be a true busy wait loop and will simply hog the CPU for the time quanta it is allowed to run. This concept of **suspending waiting threads** is key to an efficient CPU use in any RTOS.\r\n\r\nThen, if we use an infinite loop without calling to any Service UOS ++, the thread will completely consume the CPU, which seems strange, since the scheduler not being suspended and stopping the charge timer for latch it the scheduler being active, this should not happen. Since from time to time (typically 1 ms) there will be a context switch, giving the opportunity to the other threads being executed according to the priority of each.\r\n\r\nThis is a UOS ++ characteristic or the text was not clear on this issue, being a misunderstanding."},"comment":{"url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/comments/241216430","html_url":"https://github.com/micro-os-plus/micro-os-plus.github.io-source/issues/13#issuecomment-241216430","issue_url":"https://api.github.com/repos/micro-os-plus/micro-os-plus.github.io-source/issues/13","id":241216430,"user":{"login":"carlosdelfino","id":369056,"avatar_url":"https://avatars.githubusercontent.com/u/369056?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosdelfino","html_url":"https://github.com/carlosdelfino","followers_url":"https://api.github.com/users/carlosdelfino/followers","following_url":"https://api.github.com/users/carlosdelfino/following{/other_user}","gists_url":"https://api.github.com/users/carlosdelfino/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosdelfino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosdelfino/subscriptions","organizations_url":"https://api.github.com/users/carlosdelfino/orgs","repos_url":"https://api.github.com/users/carlosdelfino/repos","events_url":"https://api.github.com/users/carlosdelfino/events{/privacy}","received_events_url":"https://api.github.com/users/carlosdelfino/received_events","type":"User","site_admin":false},"created_at":"2016-08-20T18:39:03Z","updated_at":"2016-08-20T18:39:03Z","body":"Got It."}}
{"actor":{"display_login":"carlosdelfino"}}