-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a version of Miou which is fully compatible with Picos #26
base: main
Are you sure you want to change the base?
Conversation
Tuples are not great, but maybe we can make a |
Picos.Spawn only allocate a concurrent task. If the user wants a parallel task, he/she must use Miou.call. This commit adds a test with picos and one example of Picos_sync to see if everything works.
What is the behaviour when a Picos function spawns a child? I've had libraries written for picos using Picos.Fiber.Spawn throw Miou.Still_has_children running under miou-with-picos. |
Miou has a structured concurrency design. This means that a subtask launched within a task must be completed before its parent task is finished (otherwise, |
Unfortunately that does not match the Picos specification. The Picos interface specifically and intentionally does not impose any particular structuring constraints on fibers spawned through it. The goal is to allow libraries using only the Picos interface to implement whatever structuring constraints they like. As an example,the
Like I mentioned, the goal for the Picos interface is to allow (essentially) any structuring constraints to be implemented as libraries that only depend on the Picos interface. This also goes for resource management. Miou uses a different kind of
and one, but not the only, motivation for this is to allow resource management similar to provided by Miou (and Oslo) to be implemented. There is now a PR towards this. It aims to redesign the At the time of writing this the PR is still a draft and work-in-progress — there are a number of design details that still need more thinking. However, the PR also includes an example "Meow" library that provides an Again, the idea here is to allow these kind of behaviors to be implemented as modular libraries that depend only on the Picos interface. This way one can use those libraries with any schedulers as well as with any other libraries implemented in terms of just the Picos interface. This way all the schedulers and libraries can be made interoperable and modular. (It does require conscious effort and doesn't happen entirely automatically, because the Picos interface does not and cannot prevent you from building modules on top of it that depend on each others' implementation details.). In this case, for example, it would be entirely possible to use the |
…ayer, to get/set the computation
I've just proposed a final patch in which a few tests taken from Picos (as far as I'm not very happy with this latest patch, which requires the use of an I'd like to re-introduce that this PR remains an experiment. It's normal that the result obtained may not correspond to what we theoretically expect: in other words, even if this PR lays the foundations for possible compatibility with Picos, I can't guarantee total compatibility with everything Picos can offer (and that's not my objective). To clarify my position:
So, venturing outside this framework is bound to come as a surprise when it comes to Miou's behavior and what one might imagine with Picos (considering its examples). Above all, this PR should be seen as an effort on my part to create bridges, but also a concretization of these bridges with Picos (to get out of theory) with the emergence of “details” which, as far as I'm concerned, don't satisfy me at this stage. From these details, we can concretely discuss with @polytypic a possible direction about Picos and/or Miou that can satisfy us all. The idea is to consolidate these bridges: but a bridge has two parts that must come together - this PR is the culmination of only one of them 😉. |
Apologies if you caught a near incoherent complaint from me due to this - said code I was having trouble with actually was unstructured due to an incorrectly implemented per-domain loop system, but these patterns are harder to identify when they are being enforced at a different level to the code you are actually writing and do not appear in picos.fifos backed testcases. If Picos provided these constraints, would it be expected for implementations like Miou to refuse picos code that is not explicitly written with Meow? (great for safety, but imposes the slight cost that libraries will have to target specific schedulers) |
/cc @polytypic /cc @ada2k
This is a first attempt about a compatibility layer between Miou and picos. Actually, Miou uses only
Picos.Trigger.Await
, so a library which wants to work on Miou and another scheduler should just usePicos.Trigger
andPicos.Computation
: the rest is not handled by Miou1.I also think it's a drawback that Picos defines its own
Picos_exn_bt.t
type when the latter can be a simple tuple (and thus become a simple alias rather than a real type defined by Picos).Once again, it's an experiment at this stage, which implies one thing above all: that @polytypic will henceforth be careful about API changes that may break code (welcome to the wonderful world of maintenance 😉).
Footnotes
This brings to the surface the question of the Current effect which, once again, seems to me better to give a single integer rather than the whole Fiber object. ↩