{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/11226","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/11226/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/11226/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/11226/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/11226","id":423663327,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYzMTgzNTIx","number":11226,"title":"core: Make support for multi-tasking optional","user":{"login":"maribu","id":2041729,"node_id":"MDQ6VXNlcjIwNDE3Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/2041729?v=4","gravatar_id":"","url":"https://api.github.com/users/maribu","html_url":"https://github.com/maribu","followers_url":"https://api.github.com/users/maribu/followers","following_url":"https://api.github.com/users/maribu/following{/other_user}","gists_url":"https://api.github.com/users/maribu/gists{/gist_id}","starred_url":"https://api.github.com/users/maribu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maribu/subscriptions","organizations_url":"https://api.github.com/users/maribu/orgs","repos_url":"https://api.github.com/users/maribu/repos","events_url":"https://api.github.com/users/maribu/events{/privacy}","received_events_url":"https://api.github.com/users/maribu/received_events","type":"User","site_admin":false},"labels":[{"id":91234472,"node_id":"MDU6TGFiZWw5MTIzNDQ3Mg==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Area:%20core","name":"Area: core","color":"6600ff","default":false},{"id":100135107,"node_id":"MDU6TGFiZWwxMDAxMzUxMDc=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Discussion:%20RFC","name":"Discussion: RFC","color":"66ccff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2019-03-21T10:35:26Z","updated_at":"2019-03-22T07:22:08Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/11226","html_url":"https://github.com/RIOT-OS/RIOT/pull/11226","diff_url":"https://github.com/RIOT-OS/RIOT/pull/11226.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/11226.patch"},"body":"### Contribution description\r\n#### Summary\r\nMade multi-tasking support optional via module `multi_tasking` and enabled it by default. Added alternative implementations of parts of the `thread` API and the `mutex` API that are used when multi-tasking is disabled. These implementations heavily exploit the fact that only a single thread is present then.\r\n\r\nTo avoid resolving complex dependencies between core and architecture depend code in a single PR, this PR adds some workaround code to mock the scheduler API. This is not intended to stay\r\n\r\n#### How to Use\r\nBuild with your application using\r\n    \r\n    DISABLE_MODULE=\"multi_tasking core_msg\" make\r\n\r\n(`core_msg` needs to be disabled as well, as it depends on multi-tasking support\r\nand will pull `multi_tasking` back in if not disabled as well.)\r\n\r\n#### Concept\r\nThe idea is that most code not requiring multi-tasking support can be compiled unmodified with multi-tasking disabled. This can only be achieved by providing all RIOT APIs that can be used more or less reasonable in a single-tasking environment. The implementation of these APIs range from total mock versions (e.g. `thread_yield()`) that simple don't do anything to specialized implementations (e.g. `mutex`), that exploit the fact that code can only run in two contexts: In the single thread or in ISR context.\r\n    \r\n#### Outlook\r\nCurrently mock APIs for internal stuff like `sched_context_switch_request` and `sched_task_exit()` and `sched_run()` are also provided, as the platform specific code relies on their existence. By making the platform depended code aware of single-tasking, a lot of code could be elided there as well. This would ultimately allow to drop the mock APIs from `sched.h` for the single-tasking flavour of RIOT.\r\n\r\n#### Numbers\r\n\r\n(OUTDATED!)\r\n| Board           | `text` | `data` | `bss`  |\r\n|:--------------- | ------:| ------:| ------:|\r\n| `nucleo-f303re` | -812B  | -12B   | -2000B |\r\n| `arduino-uno`   | -1664B | +168B  | -874B  |\r\n\r\n(Negative numbers sizes means disabling multi tasking resulted in lower memory footprint, positive means memory footprint increased. I compilied with `BUILD_IN_DOCKER=1`.)\r\n\r\n### Testing procedure\r\nEverything but `examples/hello-world` should compile and run as nothing ever happened, as multi-tasking support is enabled by default. In `examples/hello-world` multi tasking support has been disabled, but it hopefully still compiles and runs as before\r\n\r\n### Issues/PRs references\r\nhttps://github.com/RIOT-OS/RIOT/issues/11199\r\n\r\nDepends on and includes \r\n- [x] https://github.com/RIOT-OS/RIOT/pull/11228\r\n- [ ] https://github.com/RIOT-OS/RIOT/pull/11229\r\n------\r\nUpdate 1: Updated description to match the code changes\r\nUpdate 2: https://github.com/RIOT-OS/RIOT/pull/11228 is merged, rebase against master is still needed"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/475518625","html_url":"https://github.com/RIOT-OS/RIOT/pull/11226#issuecomment-475518625","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/11226","id":475518625,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3NTUxODYyNQ==","user":{"login":"gschorcht","id":31932013,"node_id":"MDQ6VXNlcjMxOTMyMDEz","avatar_url":"https://avatars3.githubusercontent.com/u/31932013?v=4","gravatar_id":"","url":"https://api.github.com/users/gschorcht","html_url":"https://github.com/gschorcht","followers_url":"https://api.github.com/users/gschorcht/followers","following_url":"https://api.github.com/users/gschorcht/following{/other_user}","gists_url":"https://api.github.com/users/gschorcht/gists{/gist_id}","starred_url":"https://api.github.com/users/gschorcht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gschorcht/subscriptions","organizations_url":"https://api.github.com/users/gschorcht/orgs","repos_url":"https://api.github.com/users/gschorcht/repos","events_url":"https://api.github.com/users/gschorcht/events{/privacy}","received_events_url":"https://api.github.com/users/gschorcht/received_events","type":"User","site_admin":false},"created_at":"2019-03-22T07:22:08Z","updated_at":"2019-03-22T07:22:08Z","author_association":"CONTRIBUTOR","body":"I'm wondering what someone's intention might be to use a multi-threaded system like RIOT if it does not require multitasking. Realizing a single-task system which can be integrated in a RIOT network can't be the intention since networking requires multi-threading. So, the only intention I see is that someone could want to use the pool of drivers. But is this really a use case which is worth to restructure the kernel and to adapt all MCU implementations?\r\n\r\nAt least for ESPs I can say, that they will never work as single task systems since SDK libraries already require multi-tasking."}}
{"actor":{"display_login":"gschorcht"}}