-
-
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
The 'threading' CLI option/build param/target property changed to 'single threaded' #1817
Conversation
I am not sure if "single threaded" is a good name. I expect that it is difficult for users to see the difference between |
What would actually happen if both |
There should be an error message. I am not sure if there is one in place right know, but setting the number of workers in the unthreaded runtime should be an error (or at least a warning). Also using |
core/src/main/java/org/lflang/generator/LFGeneratorContext.java
Outdated
Show resolved
Hide resolved
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.
This looks good to me, as long as other people are happy with the "single-threaded" terminology (there was a discussion on Zulip). Thanks Atharva!
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.
Looks good!
The absence of changes to the validator suggests that the combination of the single-threaded
and threads
target property isn't being checked for, which we should do, as @cmnrd suggested. Would you be able to fix this?
core/src/main/java/org/lflang/generator/LFGeneratorContext.java
Outdated
Show resolved
Hide resolved
I just added checks in the validator and CLI to make it illegal to set |
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.
This is nice! However, I'm not sure what workers
means. It says it specifies the "default" number of workers, but I would think that the default number of workers would be what you get when you do not specify the workers property. Also, we will now have an inconsistency with the website. I suggest starting a release-4
branch of the lf-website repo and update the documentation in this following locations:
https://www.lf-lang.org/docs/handbook/target-declaration#threading
https://www.lf-lang.org/docs/handbook/target-declaration#workers
https://www.lf-lang.org/docs/handbook/target-declaration#command-line-arguments
https://www.lf-lang.org/docs/handbook/target-language-details?target=c#multithreaded-implementation
What is the reason for allowing single-threaded: false, workers: 2 in the target properties? Shouldn't this be illegal too? |
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.
Looks good, couple of comments. We should do some renaming in reactor-c
also since "unthreaded" is used quite alot
core/src/main/java/org/lflang/generator/c/CPreambleGenerator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/lflang/federated/extensions/CExtension.java
Outdated
Show resolved
Hide resolved
@cmnrd I was thinking it's technically correct to explicitly disable the |
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.
This looks good to me. I have made some updates in the release-5 branch of the lf-lang website and requested your review to make sure I got it right. Thanks!
@patilatharva, I did not yet merge this PR due to bigger changes that were happening in #2008. I will fix this PR after #2008 has been merged. (Expect force pushes on |
…o 'single threaded'.
7a4857a
to
6380e24
Compare
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.
It seems many of these changes here are not related to moving from threading
to single-threaded
. They seem to part of the general target-property updates? I did not look closely on them because I think I am lacking that context. Otherwise looks good. But we are still code-generating LF_THREADED
and LF_UNTHREADED
so I guess we should move to LF_SINGLE_THREADED
to be compatible with the reactor-c PR?
core/src/main/java/org/lflang/generator/c/CPreambleGenerator.java
Outdated
Show resolved
Hide resolved
Co-authored-by: erling <[email protected]>
Right, there is some overflow from #2008 that crept into this PR, but that's OK; they are closely related and I had to quite drastically alter the code in this PR to accommodate the changes in #2008. |
@lhstrh, there is a segfault in one of the federated Python programs, not reproducible on my end. Also very hard to see how the seg-fault in Python is due to doing this renaming |
I also think it's unlikely that this is due to these changes in this PR. Maybe it's related to lf-lang/reactor-c#293. |
The problem is that our |
Todo:
workers
andsingle-threaded
single-threaded
on a federated program.Also fixes #2080 in the sense that we now adjust paths for any target property that extends
FileListProperty
.