-
Notifications
You must be signed in to change notification settings - Fork 52
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
either
, the par
block that is ready to be done
#1766
Comments
either
, the par
block that dies quicklyeither
, the par
block that is ready to be done
For a tiny bit more context, @anshumanmohan and I chatted about this today and I mentioned it because the need for something like this also came up earlier, with @nathanielnrn, in the context of #1733. |
Hm, that's an interesting idea! FWIW, in other dynamically scheduled ILs, this the similar to the difference between a "lazy fork" and an "eager fork". The former forwards tokens as soon a particular child is done while the latter waits for all children to be done. We should think carefully about the semantics of this. What happens to the |
Indeed, the way this would have to work is that the "loser" (the thread that runs longer) gets aborted early, by having its In both cases where this has come up, the situation has been that one of the two threads wants to be an infinite loop: a "daemon thread" in software terms. In those situations, early termination is exactly what you want. But it's an open question whether this possibility can be tolerated by all components. To state the obvious: while no current Calyx control statements do this early termination, it is of course currently possible to do it "structurally" (i.e., by manually assigning to a component's or group's |
Right! But all control operators very much have "run to completion" semantics which are useful when frontends generate code. Specifically, what kind of frontend generated could would tolerate early abortion? If one of the threads |
Instead of having something like I am primed to dislike
implemented clumsily in terms of |
Since synchronization was mentioned, link to the experimental |
I like @hackedy's example here; the "stopwatch" thread makes it very clear that it would be hard/impossible to give semantics to I also like the alternative of actual synchronization. To spell it out, the alternative would look impressionistically like this:
That is, the two |
We had a super useful synchronous conversation about this today! A major outcome was that we liked the explicitly synchronized version of the solution to the problem, at least for the situation where the "loser" is a We also talked about a different situation, though, which is where the "loser" is (by necessity) a single group—for example, one that needs to "block" some signal from the external world, like an AXI port. It is less obvious how to make the explicit synchronization happen there; certainly, it won't work to just use This seems to inform a need for the future design of a more complete synchronization facility in Calyx: we'd like something like
That is, there is just one point where it makes sense to put
In this setting, This more sophisticated synchronization thing is obviously a much bigger topic that is a project unto itself, but I think we all agreed we prefer that prospect over |
Thank you Adrian for the summary of our meeting! I'm closing this thread. |
Consider the case where you need:
where the former group finishes in some reasonable time but the latter runs forever or is perhaps dependent in some way on the former. The code above is clearly a bad idea; the
par
block will run forever because it will wait for both of its children to be done.The present solution involves writing an ugly RTL-like group. This group:
group_finite.go
.group_infinite.go
.done
signal togroup_finite.done
.A related issue is that, in moving to low-level RTL land, we lose nice high-level constructs like
invoke
. We must hand-write desugared code that really should have been created for us by the compiler.We could do with a new high-level construct, provisionally (and badly) named
either
, which is a lot likepar
. The difference is that it isdone
when either of its children isdone
.The text was updated successfully, but these errors were encountered: