Organisationsocaml-multicorepicosbranch/mainBuild History

Build History for branch/main

Builds (454)
Upgrade ocamlformat to 0.27.0
0abaad
Work around breaking change in `js_of_ocaml` 5.9.0 `js_of_ocaml` 5.9.0 started using `node:` prefixed modules, which do not exist on old node versions.
84d542
Upgrade to cohttp 6.0.0
6ccc15
Format code to reduce diffs
3d354d
Separate tests of `Run` module
a8b3a8
Don't refer to `caml_ml_domain_id` on OCaml 4 See #332 Co-authored-by: Hugo Heuzard <hugo.heuzard@gmail.com>
bf0bdf
Fix typo
6d64d2
Fix typo
f8ab86
Specify `Spawn` more strictly with respect to cancelation Co-authored-by: Edwin Török <721894+edwintorok@users.noreply.github.com>
05fc7f
Grammar
9f446e
Grammar
d6fdbe
Grammar
a2cb3d
Add another example using the lock-free hash table
419a4a
Reduce memory use of external reference counting This uses the recently added `try_compare_and_remove` operation in the hash table to avoid having an extra `Atomic` indirection. This also simplifies the update logic.
a97c4f
Add an example of a randomized lock-free bag
33c1c8
Adjust logo color
45a823
Link to landing page
1272ab
Add `P I C O S` logo
878dbd
Fix `picos_std` package to depend on `picos_aux` Also, upgrade dependency on `backoff` from 0.1.0 to 0.1.1.
e3dbf4
Make sure tests on OCaml-CI tests pass on Windows
ec3d2d
Upgrade version number in `dune-project`
75c9bb
Release notes for 0.6.0
ebfecc
Refine the `Awaitable` abstraction The use of `Trigger` is exposed to allow awaiting for multiple things. The internal cleanup is made more robust to make sure awaitables will not be leaked.
18ecef
Elaborate on the use of `Awaitable.(signal|broadcast)`
1ba335
Clarify documentation of `Computation.canceler` Co-authored-by: Carine Morel <carine@tarides.com>
0c8d97
Fix the documentation of `Fiber.FLS.create` Co-authored-by: Carine Morel <carine@tarides.com>
52b92b
Simplify sample mutex implementation
f79755
Grammar
e96159
Wordsmithing
865c6c
Add futex-line `Awaitable` atomic location abstraction
ffcbe2
Add a note about the use cases of `Trigger.from_action` Co-authored-by: Carine Morel <carine@tarides.com>
fbc412
Remove file that was accidentally added in a previous commit
6b6d22
Add missing and useful ops to hash table
201671
Use `Countdown` from `multicore-bench`
19f7f0
Make sure `sherlodoc` is installed when updating docs I noticed I had updated docs without `sherlodoc`, which results in not having the nice search bar with the docs. This should prevent that from happening again.
30816b
Move libraries to top for quicker navigation
7eac8b
And more tweaks to improve code size and performance
7692f1
Further tweak to reduce stack usage
2c5c80
Tweak to reduce stack usage
b4ea53
And tweak more for performance
44f67c
Delay pair destructuring to reduce code size
9ab7b9
Explicitly call to raise error from tail position
2d1820
Further tweak fast paths when (a)waiting or peeking computations
49137c
Another performance tweak This moves the conversion of completed state to an option to a non-inlined function, which allows the usually vastly more common case to be inlined.
ea3e82
Tweak for performance The `Returned | Canceled` cases are less likely. Grouping them together reduces code size and improves thruput.
795cf5
Prefer `invalid_arg` over `assert` in `Fiber.unsuspend`
03dbf7
Tweak to reduce code size
34a46c
Tweak to reduce stack usage
cce016
Minor tweaks to reduce code size
61e8f8
Minor performance tweaks
4bd189
Use `picos.ocaml5.ml` on OCaml 5 and generate `picos.ml` on OCaml 4
43a4e2
Tweak to reduce code size
de5962
Minor performance tweaks Trigger operations do not need to be recursive.
fe5fe9
Tweak conditionals with CAS It seems the native OCaml compiler generates suboptimal code when one uses the `||` or the `&&` operators.
b458d6
Use dune to build picos core as a single file
05dabd
Plug compiler generated space leaks in `Bundle` The lifetime of bindings referenced by a closure in OCaml may be incorrectly extended as a reference to the closure record is kept alive for too long. These changes work around that compiler bug by calling a non-inlined function at the start of the closure, which forces the compiler to generate code to extract all the bindings from the closure record and turn them into ordinary bindings.
849dea
A motivating example of structured concurrency
a5e27a
Note that canceling a promise does await for the fiber And also explain the reason behind this design choice within the sample library.
c57a9c
Further tweaks to reduce stack usage
4c45b8
Bench `(Bundle|Flock).join_after` memory usage
a5ea38
Also retry `socketpair` on `EINVAL` on Windows
ee47e6
Tweak to reduce stack usage of structured fibers
356383
Tweak to reduce CPU stack usage of finalizers
6fb2a2
Include stack usage in memory usage benchmark This also changes the label to emphasize that this include both stack and heap.
1b4b94
Build core on 4.12
65b4de
Note and test that certain operations are not cancelable This can help to simplify and optimize code in some cases as these operations are often used in finalizers.
f03bb6
Optimize mutex and semaphore for speed on low contention
e0ba28
Add an example running Lwt and FIFOs in a single program
8eeef6
Remove version number from generated docs
2ef88a
Avoid `Fun.protect`, because it doesn't know about cancelation
43f30e
Also retry `socketpair` on `ENOENT` on Windows
2563df
Add `lastly` as a safer alternative to `Fun.protect` The problem with `Fun.protect` is that it doesn't forbid cancelation propagation.
20f796
Change `poison` to `poison_at` and add `poison` with `?callstack` This should make `poison`able data structures more convenient to use.
95b336
Add `run_main` This is convenient for use with MDX, which does some magic when you refer to `Lwt`, which can break things.
b006be
Start release notes for next version
695eb7
Number of alive fibers need not be atomic in the FIFO scheduler
43c1dd
Note on use cases of `Control.protect`
433433
Warn about `Fun.protect`
5c9d65
Forbid cancelation propagation during `release` I was previously undecided on whether it should be done implicitly, but it has turned out to be surprising, so, now I'm convinced that the right thing to do is to forbid cancelation propagation during resource `release` calls. The issue is that if a fiber gets canceled, then resource `release` operations that might need to await for something asynchronous may not be properly run to completion. This can be surprising and, also, because this only happens in cases of cancelation, which could happen at any moment, could be a major source of subtle bugs. The downside of forbidding cancelation is that in some cases a `release` operation might block indefinitely and this can also cause issues. However, I believe those cases will be both harder to miss (your program hangs rather than leaks) and easier to debug (a debugger or stack trace should be able to point you to the `release` call).
e86098
Adjust amount of simulated work
5e5a43
Also retry socketpair on `EACCES`
6c3ffc
Add an example of running a program with multiple sample schedulers
953e22
Fix doc references
89014a
Require multicore-bench 0.1.5 with better error handling
3b321b
Remove unnecessary use of `Obj.magic ()`
8acf2e
Add `FLS.remove`
fa36b3
Test, just in case, that there are no FD leaks
12af9b
Work around Uri not being thread safe See [issue in Uri](https://github.com/mirage/ocaml-uri/issues/178).
c765cc
Fix to use `await` as there is a race
d2aa36
Use the new `Computation.peek_exn` when computation is completed The new `Computation.peek_exn` should be preferred over `Computation.await` in cases where the computation is supposed to be completed already.
fa1da8
Attempt to work around `Unix.socketpair` issue on Win32 `Unix.socketpair` occasionally fails on Windows: ```diff --- a/_build/default/lib/picos_io/picos_io.mli +++ b/_build/default/lib/picos_io/.mdx/picos_io.mli.corrected @@ -753,7 +753,5 @@ end send_string "Hello, world!"; send_string "POSIX with OCaml"; end - Hello, world! - POSIX with OCaml - - : unit = () + Exception: Unix.Unix_error(Unix.EADDRINUSE, "socketpair", "") ]} *) ``` This introduces a work around to retry `Unix.sockepair` a few times on Win32 when the `EADDRINUSE` error is raised. We shuld remove the workaround once the root issue is fixed.
376152
Raise proper error when select has not been configured Also do not configure select during module level initialization in the test scheduler.
2e0567
reflect version in opam files
eb7220
Note that `Exn_bt` was removed
759ab1
Test cross scheduler wakeup Similar behavior is also covered by the mutex and condition cancelation tests, but this is a simpler test and potentially useful on its own (i.e. this test can potentially tell that the bug is in the scheduler rather than mutex and condition).
3500b3
Use GH action to check Picos core builds on OCaml 4.13
2e66ef
Rename `picos_stdio` to `picos_io` This avoids a linting warning on OPAM CI.
1f1859
Release notes for 0.5.0
4d5321
Allow test to fail on OPAM CI
cc4c72
Instruct to install `picos_stdio`
f319fd
Link to all libraries in the `picos` package
84cf5f
chore: add a version field to dune-project cannot pin anything but picos otherwise, the versions won't match (opam picks the latest known version or "dev" otherwise, so picos gets version 0.4 and the other ones gets "dev" while requiring picos to also be "dev")
30613c
Try even harder to use all threads when there are ready fibers
9d5b83
Use same STM test count and time budgets on all targets This is now possible, because the tests are being run with a time based budget and that prevents tests from taking way too long on slower targets.
60269b
Fix documentation links
b0265b
Split Picos into multiple packages and remove `Exn_bt` This splits the picos package into several smaller packages, roughly: - `picos` -> (`backoff`, `thread-local-storage`) - `picos_aux` -> (`backoff`, `multicore-magic`) - `picos_std` -> `picos`(, `backoff`, `multicore-magic`) - `picos_stdio` -> `picos_std`, `picos_aux`, and `unix`(, `mtime`, `psq`) - `picos_stdio_cohttp` -> `picos_stdio`(, `cohttp`, `fmt`, `uri`) - `picos_mux` -> `picos_std`, `picos_aux`, and optionally on `picos_stdio` - `picos_lwt` -> `picos_std`, `picos_aux`(, `lwt`) - `picos_meta` -> all of the above for integration tests and to simplify dependencies of other packages The above changes should make it easier for people to depend only on the packages they need. A single package with dependencies to `lwt` and `cohttp` is just too heavy. This also removes the `Exn_bt` module and type entirely. It is impossible to have such a module in OCaml. Due to the split to multiple packages the structure of the documentation has also been updated. Currently odoc doesn't support references between packages, which, unfortunately, downgrades the quality of the documentation.
53fe09
Work around `Domain.spawn + Domain.join` not keeping stack traces
377b93
Use a quota when running tests with FIFO schedulers The quota is selected from the range [1, 100]: - A quota of 1 is an edge case worth testing. - A quota of 100 is high enough that fibers are unlikely to encounter it during most tests. This also changes the test scheduler to print details on the scheduler in case the `main` raises.
abb2fe
Optimize to not spawn for the last `main` with `Run.(all|any)`
7c20b5
Fix not stop looking for fibers to run as long as any are ready
383e3e
Fix to really try to use all threads Whenever there are idle runners and ready fibers a runner is woken up.
4ca8f4
Add `picos_multififos` to the binaries benchmark
6d0e04
Drop unnecessary dependency
53212d
Elaborate on event contract
4c63f1
Prefer `begin end` when grouping statements
7eb302
Add a multithreaded (mostly) FIFO scheduler
bee8d8
Ensure `instantaneous_domain_index`
210089
Add `Picos.Computation.peek_exn` (#245) * add `Picos.Computation.peek_exn` `peek` is often used in the fast path of some operations, so ideally it should not allocate. * perf: help `Exn_bt` functions be inlined for accurate results if `Exn_bt.get` isn't inlined it might clobber the current backtrace; if `Exn_bt.get_callstack` isn't inlined it would show its own frame? * doc * doc * minor refactor * Note on why we always inline `Exn_bt.get` and `Exn_bt.get_callstack` * Doc reformat --------- Co-authored-by: Vesa Karvonen <vesa.a.j.k@gmail.com>
b507ca
Reduce minimum benchmark runs to avoid taking too much time on CI
72d782
Add `Picos_mpmcq.length` and tweak for performance
83bfb1
Also run `Picos_mpmcq` bench
d2101b
Link to `Tx` documentation
825ec3
Add `Picos_mpmcq` bench
70a18a
Drop redundant divide by 1
a33462
Fix `Picos_mpmcq.pop_exn` incorrectly reporting queue as empty This is difficult to reproduce &mdash; I've witnessed this having happened exactly once on the CI, but the bug seems obvious as explained in #224.
b4d44f
Simplify FLS interface
ceea8e
Add a basic test for the `Computation.Tx` interface
831c40
Add a basic test for the `Computation.Tx` interface
811909
Add a basic test for the `Computation.Tx` interface
92225f
Add transactional interface for completing multiple computations
e6c5ba
Note about need to `Picos_select.configure` with multiple threads Addresses issue #234 Co-authored-by: Lee Koon Wen <koonwen@gmail.com>
05797a
Upgrade to `thread-local-storage>=0.2`
b910b9
Adjusted spacing in comment
82c7fe
Add optional argument to terminate `Bundle` and `Flock` on return
90550f
Add internal `Q.add` helper
26a190
Must have yielder per fiber
b6df6c
Simplify semaphore benchmark fiber management
15b000
More links to reference
5f53e7
Which `picos_sync` test occasionally hangs?
558292
Link to documentation index page
76072d
Add `Stdlib` style `Semaphore` module to `Picos_sync`
98c80d
Use `sleep` instead of `yield` In this case, when using the randomized scheduler, `yield` may not let all of the children proceed.
9efeb7
Increase image size
bce109
Another link
ceaefe
More links
d09161
Links
14209c
Add hard deadline to cancelation test
d46de2
Avoid creating lots of or unnecessary systhreads on OCaml 4
d1413c
Link to libraries in reference manual
220a38
Fix to not cancel computation In case of spawn failure This seems to have been introduced in PR #210 and is not how spawn is specified to behave.
41357a
10k seems like a fine limit
bbc69e
Avoid spawning fibers in cancelation test It is not necessary to spawn fibers and doing so is very expensive on OCaml 4. It might be that this was the reason the test seems to hang occasionally on some OCaml 4 test machines. Could something go wrong and cause a thread never to run on OCaml 4?
b4afd5
Introduction to Picos
d3066d
Update ecosystem diagram with some background for visibility
d23fdf
Add Picos ecosystem diagram
0de38b
Symmetry
d5a641
Adjust mutex bench for OCaml 4
d93723
Avoid entry reallocation
7f2584
Must not use more than one domain Otherwise output may be garbled.
329bfb
Prefer `Picos_randos` over `Picos_fifos` in MDX tests
791862
Fix off-by-one error in `read_line`
c1a165
Disable HTTP test based on OPAM_REPO_CI
be19c5
Link to Cohttp project
9021b9
Add an example of using Cohttp
10ca0e
Fix to fully transmit body I noticed that when using the bytecode interpreter the request/response body was not always properly transmitted --- a test will appear in a separate PR. This simplifies the client to not try to write things concurrently and changes both sides to shutdown the connection partially after being done with writing or reading. This seems to have eliminated the issue.
10565c
`s/funtions/functions/g`
5517d7
Add minimalist Cohttp implementation using `Picos_stdio`
f4e9bd
CI maintenance
8c3515
Avoid check
317521
Explain use as a building block of a multi-threaded scheduler
c6b852
Add multi-producer multi-consumer queue allowing pushes to both ends
ca1873
Drop default argument
02fbf9
Don't reduce remaining quota in `current` `Fiber.current ()` can be very performance critical. So, it is perhaps better not to make it any more expensive than necessary.
b709b9
Fix `spawn` handler of `picos.fifos` to refer to current fiber
7802d2
Use TLS to store current fiber in `picos.randos` This allows the effect handlers to be preallocated once and the space taken by a fiber reduced significantly.
ba8e85
Redesign `Spawn` and introduce concept of fatal errors
636efc
Fix to actually update the quota
2b3a23
Further optimize bundle and flock per fiber memory use
948615
Also benchmark memory use of flocks
54339a
Add separate memory usage benchmark for promises in a bundle
dda399
Optimize `Bundle.fork` to not use per fiber computation Per fiber computation is only needed when a fiber is forked as a (separately) cancelable promise.
dfe19d
Reduce per fiber allocations in `picos.fifos`
c89b5c
Don't make people click links
705d9b
Add a benchmark of memory usage
3d802f
More permissive assertions to avoid flakiness
96af35
More flexible terminate to avoid flakiness
895357
Refer to cancelation as a signaling mechanism
a81887
Note on calls from outside of a flock
22219b
Drop unused `bundle` parameter
3b5622
Add an implicitly propagated flock of fibers
25b5bb
Prefer not to appear as an allocation
4185b0
Edge case adjustments Changes: - Always `Trigger.signal` after transfer/release has completed. This just makes sense. - Capture stack trace in handlers explicitly before calling user given code. This has the downside that capturing a stack trace allocates, which is both expensive and, I assume, also allows an asynchronous exception. OTOH, in most cases it is likely better to ensure stack traces are captured properly. - Establish handler before call of`Trigger.signal`. As specified in the documentation, `Trigger.signal` should not raise, but it is perhaps better not to trust this.
d02ae4
Redesign resource management to use only one binding operator
140d07
Make example less flaky
22f99a
Reuse internal `let_at`
8b8de0
Move `Picos_structured.Finally` into its own lib `Picos_finally` The `Finally` module is useful independently of the fiber management model provided by `Picos_structured`. This also introduces a number of changes: - The `finally` type is renamed to `template`. - The `moveable` type is renamed to `instance`. - The semantics of `let^` is changed such that it also releases the resource in case an exception has been raised in the scope. - A borrow mechanism is added, as the `let&` binding operator, to allow one to use a resource acquired as a resource `instance` before moving the resource to another scope. - A way to explicitly `release` the resource held by an `instance` movable is also added.
7e6590
Add `Picos_randos.run_on` helper for running on multiple domains Also avoid using `Domain` and `Unix` modules in the examples in the documentation.
06721c
Set random seed for each QCheck STM round
a463dc
Add deadline to mutex cancelation test On 4.14 presumably the mutex cancelation test sometimes takes too much time to get the desired number of various cancelation points. This explicitly limits the time the test is allowed to take.
f923ae
Expand on comment
f02b85
Tweak `Finally.(let^)` for performance This moves allocations to the same block (so the compiler can merge them), reduces total allocations by one word, and avoids an unnecessary `Atomic.set`.
f7ec09
Fix `Finally.move` to be lazy
d08c26
Change `Control.block ()` to raise `Sys_error` when forced to return It is technically possible to finish the computation of a fiber from outside of the fiber when using the low level Picos interface so it is not strictly impossible for the `Trigger.await` inside `Control.block ()` to return `None`.
a255a1
Add a few more blockers to the cancelation example
3c0ff9
Limit running time of QCheck STM tests
74a8ff
Drop timeouts from the beginning to reduce flakiness
864419
Add `Event.always`
decee1
Skip benchmarks with too many domains
8b734e
Add a many-to-many, poisonable stream
97f780
Rename `Ivar.peek` to `Ivar.peek_opt`
7a0986
Wordsmithing
e4ceda
Add couple of examples of using `Control.terminate_after`
306338
Add incremental or single-assignment poisonable variable An `Ivar` can be implemented trivially using a `Computation`. This PR also adds an example of how one can move resources between threads using the resource management helpers provided by the `Picos_structured.Finally` module.
9a8729
More descriptive names for tests
cf5931
Prefer `LIFO` with computation `LIFO` is (likely) faster and doesn't matter when e.g. there is just one awaiter.
040e6d
Reduce message counts in naïve bounded queue bench This benchmark seems to be taking too much time on some platforms. This likely means that the mutex implementation should be improved.
600233
Try to avoid poll in `Control.terminate_after` between critical ops During a poll point the OCaml runtime may e.g. handle Ctrl-C (i.e. SIGINT) and raise an asynchronous exception that could cause leaks.
622ef4
Move error handling out of hot code.
29502d
Add `Control.terminate_after` and `Bundle.terminate_after`
0b7020
Fix bounded queue example to use `Condition.broadcast` Using `Condition.signal` is not correct in these cases, because it is possible that multiple fibers manage to start `Condition.wait` and a single `Condition.signal` does not wake up all of them. Another alternative would be to `Condition.signal` every time the queue is not empty or is not full.
f5a518
Skip benchmarks with too many domains
9772aa
Allow `let@` to be inlined This allows a decent optimizing compiler to eliminate the tuple allocation. Unfortunately, at the time of writing, `ocamlopt` is not such an optimizing compiler, but Flambda seems to be able to do it.
c5e4ed
Fix all sample schedulers to complete the root computation
6adcad
Add a naïve bounded queue benchmark
ebc8f5
Prefer structured concurrency in tests
e306c6
Avoid raw `Fiber.spawn` in tests
f171b5
Add `Promise.terminate_after` Also avoid use of raw Picos API in tests.
bed829
Use `Bundle` in `Yield` benchmark Avoiding the use of the raw `Fiber` API.
d52e28
Adjust timeouts to avoid flakiness
423343
Simplify `Mutex` cleanup logic
cc3b63
Bench `Mutex` with higher fiber counts to exercise the queue
757839
Use scalable `Countdown` in benchmarks
fb6359
Prefer `LIFO` ordering
a378a1
Use `copy_as ?padded` from `multicore-magic`
ef730f
Fix `Picos_randos` to count alive fibers correctly The code for spawning fibers was probably copied from `Picos_fifos` and was also correct before enhancing `Picos_randos` to support running on multiple cores. With multiple runners the count must be updated before pushing new `Spawn`s into the collection, because otherwise the count may incorrectly become `0` too early.
8c05ef
Add blocker using `Latch` to cancelation example
af5aea
Change to use the `Lwt_unix` notification mechanism Previously I had rolled my own version of a notification mechanism as I didn't know one already existed in `Lwt_unix`. This PR changes `Picos_lwt_unix` to use the existing mechanism provided by `Lwt_unix`.
c25861
Make select test less flaky by ignoring extra timeouts
39e41f
Use multicore-bench with suite order randomization This exposes variation due to effects that individual benchmarks have on the runtime state.
207867
Split assertion to get more detail
1ef639
Document `Bundle` behaviour in more detail
1d94b0
Change `Control.block` to raise when cancelation has been forbidden
75263e
Wordsmithing
223990
Fix wording
51895f
Add `Event.from_computation` and a `Promise.completed` event
6a9429
Avoiding repetition and moving rarely needed info out of the top
025c2a
Point to example in `Picos_select` library
0e87d5
Alternative design for composable events Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
fc2a68
Elaborate further on the ability to get a notification
894c15
Formatting
ee4042
Note that the notification mechanism is the heart of computations
62cf0c
Include sizes of private sub libraries
22aa3e
CHANGES for 0.4.0
7d85f8
Add optional example using cohttp-lwt through Picos
b36920
Drop thunking from `Picos_lwt.await`
bb8aa7
Wordsmithing
31e8e3
Try to avoid contention on back of the queue
ecb8fa
Test on 5.2.0 on Windows Co-authored-by: Kate <kit-ty-kate@outlook.com>
fdf8d2
Tweak code snippets
4d6bc5
Change `Picos_lwt` to take `module System` as argument The `System` module is then used to give both a `sleep` function and a kind of trigger mechanism. The trigger mechanism is needed to be able to safely wake up Lwt in a multi threaded and/or multi domain program.
ac8cb5
Finish computation to avoid leak on `EINTR`
5a2edc
Allow running test from the root of the project
1d06aa
Get `instantaneous_domain_index` at `create` to schedule `at_exit` See: https://github.com/ocaml-multicore/multicore-magic/issues/12 By getting the index at `create` the `Domain.at_exit` cleanup is hopefully registered early enough.
a95811
Implement `Picos_htbl` using `Atomic_array`
4aee40
Use `make_contended` and forget about padding the main record
5aa829
Bench hash table primarily by number of workers This avoids making the internal counter of the hash table wider than necessary.
9392f2
Use `Atomic.make_contended`
9de59a
Try to reduce sizes of libs
931143
Avoid cost of `include` The `include` construct at the module level is quite expensive in terms of generated code size.
ec0b71
Allow to specify min and max buckets in `Picos_htbl`
8fa683
Refer to Picos as an interface rather than as a framework
63bd89
Initialize hash table on each benchmark round
5f3a70
Add bench of binary sizes This is useful for avoiding code bloat.
bea39d
Perform `Picos_stdio.Unix` bench using multiple smaller blocks This mirrors change in a similar benchmark in multicore-bench.
8282e2
Avoid allocating state when computation has no triggers attached
83b3c2
Try to make `select` test less flaky
f6d3e0
Refactor to avoid code bloat in hash table This avoids some code duplication/bloat in the implementation of the operations (grow/split, shrink/merge, copy) over a whole hash table.
c50286
Bench exponential fib with `Picos_randos`
e95df0
Bench on 5.2.x
5a54cf
Make hash table write ops more optimistic This could improve write performance.
a6e20a
Elaborate further
6a1a4d
Rename `Picos_mpsc_queue` to `Picos_mpscq` This in preparation for further additions and also finally corrects the benchmark name, which used to refer to "foundation", which was an internal library that has since been removed.
e96335
Support multi-threaded use in `Picos_randos`
d2de21
Elaborate on contracts
5486c2
Report exceptions from server and client test
234256
Optimize `Run` module operations This changes the implementation of `Run.any` and `Run.all` to only use the single computation of the bundle used internally.
ae4990
Change `Picos_structured.Run.any []` to not block There are a number of reasons for making this change. While it sort of makes logical sense to block on an empty list, that can also be surprising and undesirable. This has also come up as an opinion in private communications. For example, suppose you want to use `Run.any` to start actions to try to search for a solution concurrently and the list of actions to use in the search is dynamically created. A simple program such as ```ocaml let solution = Atomic.make None in ... Run.any search_actions; match Atomic.get solution with | None -> ... | Some solution -> ... ``` might unexpectedly block in case the list of actions would be empty. The above also illustrates that it is typically not difficult to implement the blocking semantics on top of the non-blocking semantics (i.e. just block in the `None` case). It is still allowed to cancel individual fibers started with `Run.any`. Consider ```ocaml Run.any [] ``` and ```ocaml Run.any [ fun () -> raise Control.Terminate ] ``` Is there a difference between the two? Should both block and, if so, does that open more possibilities to write unexpectedly blocking code? OTOH, disallowing canceling fibers used with `Run.any` (and `Run.all`) by raising `Control.Terminate` would seem to introduce an inconsistency with respect to other constructs in `Picos_structured`. I'm happy to revisit this later in case more motivating examples arise.
e499f4
Avoid allocations in `Picos_randos`
3de562
Add `Picos_randos` — a randomized scheduler This introduces a randomized scheduler intended for testing. This seems to be quite effective for finding bugs related to cases where code implicitly depends on scheduling. It already revealed bugs during development.
319146
Test that `Run.any` and `Run.all` return as expected Also `shuffle` lists of actions
8215df
Prefer Format with fewer lines
a19f6d
Terminate is not counted as an error
db20f0
Test `Run.all` and `Run.any` report exceptions started actions
cf58db
Prefer links
095ade
Increase time bounds The upper bound could also be just removed.
37b9bd
Test `Run.all` collects all errors
fd78d7
Move examples to bottom of page
fd13ea
Fine tune MPSC queue docs
f4d2b6
Move away from MDX based tests Well, I gave MDX a chance, but then I realized one test wasn't even run, because I had misspelled the filename and MDX integration gave no indication of this whatsoever. I also find it very hard to debug MDX based tests. So, from now on MDX will only be used to check examples rather than write more serious tests.
dc95e9
Add `pop_all` to `Mpsc_queue`
3f1a7e
Make racing test less likely to fail due to non-determinism
95f9b0
Adjust docs
2a5fa5
Add an example demonstrating and explaining cancelation
fb1648
Documentation adjustments
46123d
Add minimalistic `Promise` to `Picos_structured` The `Promise` API could be extended in various ways, but I will leave that to future work.
293be1
Defunctorize `Picos_lwt` I realized there is no need to use a functor. `await` could be just moved outside of the functor and `sleep` is a monomorphic function, which can easily be passed around - a functor is overkill.
1be616
More mobile friendly
3dcb8e
More mobile friendly formatting
a9eb7e
Make the forbid argument optional in sample schedulers It still makes sense to require the fiber operations to have it mandatory, because those are not user level operations and should be as fast as possible.
342686
More mobile friendly formatting
0d2e8a
More mobile friendly formatting
3698ad
Fix typos in docs
5776b2
CHANGES for 0.3.0
bda364
Add basic structured concurrency library
98761f
Picos compatible direct style interface to Lwt
534944
Upgrade ocamlformat from 0.26.1 to 0.26.2
559ffe
Perfer a one-liner
1c650d
Adjust non-deterministic time bound
7da862
Couple of simple `Unix.select` tests
204c10
Add `Unix.select` to `Picos_stdio`
496742
Enable tests on Win32 Enable openfile and read test on Win32. Operations on files are essentially non-blocking. Using sockets we can also do non-blocking IO on Windows.
ae71ed
Prefer to use unique exception
d177ed
Adjust wording
b76eb9
When `threads.posix` exists we really need `thread-local-storage` `thread-local-storage` is needed for correct operation when `threads.posix` exists. TLS is used to store the fiber identity with `picos.threaded` and that breaks without proper TLS. I've now run into this a couple of times that I missed `thread-local-storage` from the switch and that unfortunately allowed an invalid build where `threads.posix` (and hence systhreads) existed without `thread-local-storage`.
ab6a96
Prefer shorter nominal form
2b15a3
Add basic tests using MDX MDX makes it easy to add some simple tests.
544c0e
Use seeded hash
3ec68d
Synchronize explicitly to ensure order of events
5695b9
Wording
7e29a6
Some more examples
63c091
Add some examples to documentation
f723ec
Put intent first
be5085
Link to operations
3a953f
Adjust formatting
e63b29
Fix sentence
25edad
Better to not try to have bullets with `modules`
7d85bc
Documentation tweaks
53fc9a
Check FD use more carefully
ddb7b5
Simplify select loop
b26f99
Ensure `Picos_select` is configured early enough
6f8767
Fix links
b95bde
Plural is more
9b67ba
`CHANGES` for 0.2.0
a53cd1
Document some common conventions
b8548e
Scale STM `count` parameter to avoid taking too much time on CI
7484a9
Document the optional `padded` argument
031cd9
Add custom index page for the package and restructure the intro
8cc594
Wordsmithing
da4ea6
Don't start select thread unless sigchld is handled by us
ace667
Support `Unix.wait` and related functions in `Picos_stdio`
4ad901
Add `Picos_htbl.remove_all` Remove all bindings and return them as a sequence atomically.
df69ad
Add `Picos_htbl.remove_exn` to atomically find and remove a binding
75644b
Make `Picos_select` explicitly configurable
7cf277
Move `Picos_tls` under `Picos_thread.TLS`
e876a8
Adjust wording
406fda
Let `picos.threaded` depend directly on `threads.posix`
b0d3d8
Adjust comment formatting
ecda92
Depend optionally on `picos.select`; allow `cancel_after` to raise
591219
Account for potentional exceptions in test
1b9661
Allow resume from signal handlers While [`pthread_cond_broadcast`](https://pubs.opengroup.org/onlinepubs/007904975/functions/pthread_cond_broadcast.html) is not safe to call from a signal handler, the situation in OCaml is somewhat different as [signal handlers in OCaml are called during poll points](https://ocaml.github.io/ocamlunix/signals.html#sec86) on some thread. The change in here makes an assumption that there is no poll point in `Condition.wait` before the thread has been suspended and can be resumed by a `Condition.broadcast`. If this is the case, then it should actually be possible, under the right circumstances, to use `Condition.broadcast` from a signal handler to release a waiting thread.
0d20fc
Fix typos
fa672c
Scheduler friendly `Picos_stdio.Unix.sleep*`
4ded74
Emphasize every `req` must `clr`ed exactly once
f89331
Serve `picos.svg` from `githubusercontent` to show on ocaml.org docs
f0ade1
Warn about setting shared fds to nonblocking mode
e32543
Warn about broken signals in OCaml 5.0.0
fd1cb6
Remove TODO list (moved to issues)
85e353
Allow to skip server and client test on Opam CI
28d664
Don't depend on npm on riscv
8e280d
Drop reference to deleted library
a466c1
Add brief description
624592
Warn that Picos is unstable
4a9b63
Drop redundant `package` fields
e07001
Front matter
c9d528
Use `with_action`
09c925
Clarify the internal `intr_pending` counter increment
68eb5f
Link to benchmarks on `pascal`
4e905e
Add `Picos_stdio` benchmark
b08333
Add interrupt support and implement async IO for blocking FDs
5199a3
Fix wakeup state machine
008091
Add `Computation.with_action`
34c879
Add `Computation.with_action`
0968b1
Add `Computation.with_action`
a0b3bc
Add `Computation.with_action`
8deffa
Add `Picos_htbl.mem`
ea13e2
Refactor to extract deadline computation
502b07
Prefer to explicitly use `Fun.id`
d2759a
Avoid race condition in `Lazy` cancelation test With a multithreaded scheduler it was possible for the `Trigger.await` inside the lazy computation to observe the trigger as signaled before performing `Await` where the scheduler would notice that the fiber was canceled.
709a40
`CHANGES` for 0.1.0 and documentation tweaks
17fb99
Adjust links in doc comments
ce0204
Drop `picos.ptmc` Seems superfluous with the current design. Can be added back later if needed.
e97626
Add ref counting for disposable resources and `picos.stdio` library
8b1029
No summer without opam as owner
c890a5
Adjust `(libraries ...)`
40af0e
On Win32 `Unix.select` timeout seems to have really bad resolution
955098
Avoid allocations in handlers
73950d
More links between libraries
a2ad7c
More benchmarks
6fad52
Add `HACKING.md`
007703
Fix wording
81cda9
Add `CHANGES.md` starting to prepare for first release
937f27
Add `picos.sync` library
2745a5
Add `Fiber.try_suspend` and `Fiber.unsuspend` helpers I noticed I had failed to account for one case in my previous `await` handler implementations. This fixes that by introducing a pair of helpers for suspending and unsuspending a fiber.
abc01b
Add `yield` benchmark
42cd31
Mention physical equality
95952c
Prefer public names when available
0da9eb
Avoid `domain_shims` in bench
aaf205
Limit test iterations on 32-bit platforms
f19187
Drop uses of `open struct ... end`
f20a56
The `Fiber.current ()` operation must never propagate cancelation The problem is that in order to call `Fiber.forbid fiber (fun () -> ...)` to forbid cancelation, it is necessary to call `Fiber.current ()` to obtain the `fiber`. Hence `Fiber.current ()` must not propagate cancelation. In some cases one could call `Fiber.current ()` well before performing the work that needs to be protected by `Fiber.forbid ...`, but this is not always practical.
4da71f
Publish the sample FIFO scheduler
3cba8b
Document and simplify threaded sample OCaml 4 scheduler
806fe5
Reorganize `lib` dir to separate core, i.e. `picos`, library clearly The point is to make it easier to see what the core library consists of.
541897
Adjust TODOs
967099
Use `TLS` to store handlers on OCaml 4
f61e8c
Avoid unnecessary wakeup
e75329
Avoid unnecessary wakeup
3b2a38
Add `Computation.wait`
6af9f4
Documentation tweaks
b62d6d
Fix documentation of `is_initial`, whose behavior changed recently
b56abc
Simplify signature with wildcards
3aad1e
Add (private) `Picos_thread_atomic` library
aeb2db
Add `Picos_select.await_on` for convenience
e409f8
Fix reference to `Computation` in doc comment
23ccf7
Minimalistic `Unix.select` event loop for Picos
cee8e8
Avoid duplication of `Computation.await`
edf401
Remove default behaviors on OCaml 5
67eef2
Upgrade to multicore-bench 0.1.2
fa5ba5
Avoid wide match
5eccc9
Add `alert` attributes to dangerous operations
6cbbe2
Optimize `canceler` to avoid allocations
bfdcb7
Tweak warnings in documentation
d13a03
Prefer punning notation
1dc106
Avoid float array pessimization
69b53a
Add benchmark of `FLS` excluding cost of `Current`
a02278
Test `FLS` with a `float` key
a489ea
Add some more flesh to the documentation This also adds - `Trigger.from_action` for special uses cases needed by schedulers, and - `Trigger.dispose` for safer disposal of triggers inside schedulers.
ec728d
Allow to specify the order for signaling triggers on completion The order has an effect on scheduling so it makes to allow it to be specified.
1ff21c
Add benchmark for attach detach pairs
8eb0a8
Signal triggers in LIFO order at computation completion
b3b522
Elaborate on the intent of `forbid`
44c374
Drop phantom types
e193af
Add an example of how to await for one of any number of computations
b881af
Clarify comment on lazy removal of triggers
f9f942
Upgrade DSCheck to allow OCaml-CI test on OCaml 4
ca1160
Adjust number of messages based on number of takers
143de5
Add link to benchmarks
f5ff0f
Rewrite benchmarks to run on current-bench
b6af74
Add link to Fuseau
a1a41a
Test with 5.1.1 on Windows and use sunset repository
ec2d50
Minor refactor to keep `t` as first and `backoff` as last argument
b1951c
Add `try` versions of `Computation` completion actions While the result is often not interesting, there are cases where knowing whether a particular call completed the computation can be useful.
e861ff
Testing with DSCheck
256699
Add benchmark of the MPSC queue
7df261