assert false when we use Miou.Ownership.transfer specially (@dinosaure, #123)Enforce assumptions on our Miou.Ownership module. It exists some leaks possible depending on how we schedule tasks and we enforced the "atomicity" of Miou.Ownership functions to ensure attachment of finalizers to tasks and ensure, by this way, release of resources for any situations (normal termination, exception, cancellation).
breaking change: Such pull-request changes the behavior of Miou and some of our effects don't yield anymore (specially our internal Self effect). This release will change the behavior of Miou applications. We did benchmarks on httpcats to see if we have any regression and we did not notice some (we also observed a small improvement about the throughput).
(@dinosaure, #124)
Miou.protect. Since #124, it's possible to provide a more robust Miou.protect which is able to attach a real finalizer to a function which can be executed even in the cancellation case. It's adivsed to not use effects in finalizers (as we ask for Miou.Ownership) in the case of the cancellation. (@dinosaure, #125)Effect.Deep handler and handle locally effects. It gives to us the opportunity to create bridge with some others schedulers as was initially suspected. (@dinosaure, #126)dune-configurator on the host side (@samoht, #117)Miou_unix.{recvfrom,sendto} (@dinosaure, asked by @pukkamustard, #118)Miou_unix.connect when it raises an error (@dinosaure, #119)Miou_trace.Clean to signal when Miou really clean children (@dinosaure, #121)dom0 and let it to enter into the sleep mode (bug spotted by @voodoos, fixed by @dinosaure, #120)Miou.get and Miou.Promise.state (@dinosaure, #115).git-blame-ignore-revs (#55, @mbarbin)Add trace system for Miou (#110, @dinosaure)
A new module Miou.Trace is available and allows the user to register an event consumer. The sub-package miou.runtime_events is also avaible and use the OCaml runtime events system to emit Miou's events. Some tools are now available to record Miou's events, you can check them here
Add Miou.take (#113, @dinosaure)
A new function Miou.take is available to consume tasks available from an Miou.orphans. By this way, the user is able to Miou.cancel tasks instead of just await them (with Miou.await{,_exn} and Miou.care).
handle (which runs tasks) becomes indempotent (#112, @dinosaure)Miou_unix (@dinosaure, #102)dom0 (@dinosaure, @voodoos, #104 and #103)poll(3P) (#100, @voodoos, @dinosaure)dom0 (#98, @dinosaure, reported by @voodoos)Unix.select implementation) (@dinosaure, #94)-Werror only on the released mode (@dinosaure, #93)POLLHUP event when we check if a file-descriptor is read-ready (specially for pipe) (@madroach, @dinosaure, #89)Use poll(2)/ppoll(2) instead of select(3P) (#75, @dinosaure, @haesbaert, @hannesm, @backtracking)
miou.unix now uses the poll(2) or ppoll(2) function if available (the choice is determined at compilation). It replaces the use of select(3P) and improves performance. Miou no longer needs to build lists of file descriptors to observe, but instead manipulates a bitv and an array containing these file descriptors.
The bitv implementation comes from the bitv library written by @backtracking, who kindly allowed us to relicense it under MIT.
Finally, a special thanks to @haesbaert, who originally wrote [ocaml-iomux][iomux], which provides a portable implementation and an OCaml interface for using poll(2)/ppoll(2).
The use of poll(2)/ppoll(2) should improve performance, as noted in the PR, particularly with regard to our httpcats HTTP server.
It should be noted that dune-configurator has been added as a new dependency for Miou. However, support for topkg/ocamlbuild is still maintained (and it is possible to compile and install Miou with this build system).
Miou_unix.run and clean-up cancelled file-descriptors (#82, @dinosaure)dom0 when one domain receive a signal (#78, @omegametabroccolo, @dinosaure, @reynir, partially fix #77)Miou.Ownership.release to disown and release a resource (@dinosaure, #79)waitpid and document it (@dinosaure, @mbarbin, #64, #66)Option.value but match .. with to calculate the optional length for Miou_unix.{read,write} (@kit-ty-kate, #44)List.iter instead of Hashtbl.iter for internal kept file-descriptors of Miou_unix (@dinosaure, #45)Miou_unix about suspended syscalls (@dinosaure, @kit-ty-kate, #43)reraise (@dinosaure, #46)dom0 and observe if some tasks must be transfered to it (@dinosaure, #48)ocamlformat.0.27.0 (@mbarbin, #52)x-maintenance-intent (@hannesm, #56)odoc warnings (@mbarbin, #53, #54)Miou_unix.bind_and_listen (@ada2k, @dinosaure, #27)Miou.Backoff module which can be useful for users (@dinosaure, #35)Miou.Queue module and some internal parts of Miou about the usage of atomics (@dinosaure, @polytypic, #36, #33)finaliser function for the events value and actually close the internal Unix.pipe used to interrupt domain than to use Gc.finaliser and possibly leak file-descriptors (spotted by @hannesm, @dinosaure, #37)Don't try to abusively fill the pipe to interrupt a domain
Interrupting a domain involves writing to a pipe to interrupt the select(2) if it is running. The pipe has a limited memory, depending on the system, and if you ask to interrupt a domain too much, you end up blocking the write. This patch prevents writing to the pipe if it has not yet been read.
(@dinosaure, #46)
Be able to add a hook (effect free) into the scheduler
It is possible to add a hook to the scheduler. If the user wants to execute a function to a domain each time the domain is busy with a task, they can do so. However, the effects are not managed in the passed function.
(@dinosaure, #48)
Miou.Lazy, a domain-safe Lazy module like Stdlib.Lazy (@dinosaure, initially implemented by @polytypic, #49)Raise an exception if the user uses syscalls (from Miou_unix) and Miou.run instead of Miou_unix.run
If a user uses a suspend function offered by Miou_unix but does not use Miou_unix.run, the programme may block indefinitely. This patch prevents such an error by raising an exception if we want to add a suspension point and we haven't specified how to handle it (if we use Miou.run instead of Miou_unix.run).
(@dinosaure, reported by @kit-ty-kate, #51)
Miou.set_signal to Miou.sys_signal (@dinosaure, #50)Miou_unix.{read,write} (@kit-ty-kate, @dinosaure, #52, 2f552a6, #54)Fix an issue related to the dom0 and pending tasks locked by mutexes
Tasks may have been transmitted to dom0 while it was executing a task and before the select(2). This patch resynchronises the pending tasks in dom0's TODO-list before making the select(2): specifically to find out whether the select(2) can block indefinitely or not. This patch also cleans up the old states of the tables used by Miou_unix if it is used on an ongoing basis (as in the case of tests).
(@dinosaure, #53)
Miou.Domain.available (@dinosaure, #53)Fix a race condition (observed with TSan) when we wait the cancellation of a children
This patch changes Miou's behaviour a little when waiting for a task to be cancelled and prevents invalid access to a value that does not belong to the current domain (and which can be modified by another domain). Thanks @OlivierNicole and @fabbing for their advice on using TSan.
(@dinosaure, #56)
backoff) (@dinosaure, reported by @patricoferris, #57)Miou.call_cc to Miou.async (@dinosaure, @kit-ty-kate, @Armael, github#23)A major change in Miou's internals to incorporate the excellent work of Vesa Karvonen available in his picos project. This change integrates the Trigger module and the Computation module. It also uses the Await effect, which we hope will be standardised.
This addition has enabled us to integrate the new Condition and Mutex modules.
This change has enabled us to correctly formalise the resources used by our scheduler and to release them accordingly, particularly with regard to the cancellation whose behaviour is better defined.
We also took the opportunity to integrate the priority queue extracted from the Vocal project and checked using Why3. We would like to thank their authors and maintainers for their help.
Finally, the API has changed very little and only ownership is no longer mandatory when using the Miou_unix module but is still available through the Miou_unix.Ownership module.
As such, we have written a tutorial that explains in detail what Miou can offer and how to create applications with it. It's also a good introduction to using effects and implementing a mini echo server and mini scheduler.
The changes are far too profound to establish an accurate Changelog since the last beta. However, we have tried to respect our previous tests as much as possible and ensure continuity in what Miou has to offer despite its beta status. We hope that, given the changes described above, users will understand this breaking-change.
Composition between Miou and user-defined effects. @dinosaure 664e8e26ec861c4fe3672144eead70b42f5fdbe5
Miou includes a mechanism that allows you to create an effects manager using Miou's effects manager. The latter always respects the rule: one effect yields. The documentation has been updated accordingly. Tests 28 and 31 show an example of effect composition.
Integrate the test t26 & t27. @dinosaure 885d86eeedede3b28f6467bc2f0343b2ccf71225
Test 26 verifies that Miou does indeed perform an infinite loop if a system event handler has not been installed and Miou.suspend is used. Test 27 is used to check Miou's behaviour with Miou.yield.
Fix the happy-eyeballs example & cancelled suspension points. @dinosaure ffa2fc059d62bf580ed6d090aaf33e26fe9571e8 bf47c1a83ad5b8607dd097b6a1547cc18c0527c8
When a task is cancelled, we have to clean up the suspension points created in this task. The code has been factorised to avoid duplication between happy-eyeballs and dns.
breaking change Be able to know if an orphans still have few tasks or not. The Miou.care returns an 'a t option option where:
Some (Some _) is a ready-to-await taskSome None informs that some tasks still exists but they are not finishedNone informs that the orphans has no more tasks@dinosaure 0560a14ea848466ea99792d27138c47f71aab747
dom0 from user's exceptions. @dinosaure 0dd647e15a859d458d6daf3ca96e3e65a30ce30fgive argument no longer transfers ownership to the new task, but copies ownership so that the task that created the new task and the new task have ownership of the resource. @dinosaure 55ff54ddfd585f52fcda4d56caf2458760a7f949Miou_unix.shutdown (like Unix.shutdown). @dinosaure 7f37ed6645965552a34070b23177dfdc4dda01fdself function: This function lets you know which promise you're in. It provides information such as the domain executing the task, the promise identifier and the number of resources it is responsible for. @dinosaure 0b1833f623e61b674105cdced64aa624f2a6340eLogs module. @dinosaure e4062178f4dee18a97fbc3ebb6fb36352d9ff9f5Heapq instead of an Hashtbl to handle sleepers. @dinosaure 32e0b8adc7a6a92e14dae12d1fa1991ce41f71a5Sys.opaque_identity. @polytypic @dinosaure 5bcdaf4dd4fbf404cfb6f89b06280e12298c50ccReverse control of task waits. Previously, Miou systematically added a step if we wanted to wait for the result of a task. If the task was completed, we ended up giving the result after several observations of the promise, which could be slow in certain situations.
Now, waiting for a task attaches the continuation to the promise. If the task associated with the promise finishes, we simply "continue" with the value obtained avoiding a systematic observation of the state of the promise until the task finishes.
@dinosaure d795f08fc64f3e53077172dbfedfcefe47a2b832 42ef35bafa21ea0c264f6f3519fcb72732c1abd8
Expose [Miou_unix.on_{read,write}]
@dinosaure 27174019f959414051bfbdb5057a17e6b7a036ee
Fix the documentation about [Miou.call] and the possible situation where no domain are available to execute a parallel task
@dinosaure, @zapashcanon aab9996ab2a3a59db2fed59f8ed997ef6f5abe14
miou