Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchroneous task #44

Open
perlindgren opened this issue Nov 19, 2020 · 0 comments
Open

Synchroneous task #44

perlindgren opened this issue Nov 19, 2020 · 0 comments

Comments

@perlindgren
Copy link
Contributor

perlindgren commented Nov 19, 2020

Synchronous tasks

In the originating work on Real Time for the Masses, tasks could also be run synchronously, i.e., one could call into other tasks as a function call, this allowed to re-factor code along the following lines (not actual syntax)

task a () // no resources used
  c (some_args) // synchronous invocation of task_c


task b () // no resources used
  c (some_args) // sync call to task_c

task c (some_parameters) // task that uses X
  X.lock(
     ...
  )

The static analysis could figure out that X was (synchronously) accessed by tasks a and b. The resource usage was local to c, so you did not need to declare it as a resource of both a and b.

Also as full program analysis was done you did not need to declare the use of resources, it was derived in the analysis.

In RTIC we don't aim for full program analysis (re-parsing all Rust is out of the scope here), so deriving resource usage and call structure is not possible. Nevertheless we could declare sync = [c] in the task attribute and have cx.sync.c(some_arg), to achieve this type of re-factorisation. Not sure if its a common enough pattern to make it worth implementing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant