-
Notifications
You must be signed in to change notification settings - Fork 63
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
USER_THREADS
specifiable in platform options
#1721
Conversation
I think this looks okay. For now it is only Zephyr which needs this so its okay to only expose it (i.e. add the NUM_USER_THREADS compile def) when Zephyr is the target platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @siljesu! This looks like a good start. I've requested some changes that are mostly to enforce conventions. Two things that I think we should add:
- a test
- a validator check to point out that this property is ignored if the platform is not Zephyr
Did you get a chance to look at Martens suggestion, @siljesu ? |
Yes, take a look at the newest commits. |
Try running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The remaining problem is that, in the test system, I explicitly set the threading=false on all tests executed by Zephyr. In the file |
OK, take a look at the newest commit. In addition, threaded Zephyr will generate an error "Threaded support on Zephyr is not supported" as of now (from lf_zephyr_support.c). This should probably be removed soon, or else threaded Zephyr tests will always fail regardless. I propose replacing it with a warning "Threaded support on Zephyr is still experimental". If you agree, I can make that change in lf-lang/reactor-c#194. |
Yes, change it into a warning about it being experimental. These two PRs should be merged together. I will then get the threaded tests running on Zephyr, at which point we can remove that warning |
OK. I have merged the changes into reactor-c. Now you only have to update your reactor-c pointer to the most recent commit on main and we can actually run the test in CI |
Silje, there is something not working with the the joining of zephyr threads. The UserThreads program does not exit as expected, rather the main thread is stuct at |
Yes, the program exits as expected when running on an NXP. |
8b01b71
to
aad2ef3
Compare
@lhstrh Lets merge this, finally... |
I noticed that this PR checked in the binary file |
Ops. That is a mistake! |
I removed it again in #1803 |
USER_THREADS
specifiable in platform options
In reference to this PR: lf-lang/reactor-c#194
USER_THREADS can now be specified under platform options in target properties:
platform: {
name: Zephyr,
user_threads: 3
}