-
Notifications
You must be signed in to change notification settings - Fork 22
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
(WIP) v0.4 release #173
Merged
Merged
(WIP) v0.4 release #173
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Block statistics
…gement);signifiicantly less overhead on entangled read barriers
Be warned! `#ifdef ASSERT` is true in all builds. This was causing the debug version of `traverseAndCheck` to run in all builds, with significant performance degradation in entangled benchmarks. I cleaned up the header and definition a little here, too.
Be warned! `#ifdef ASSERT` is true in all builds. This was causing the debug version of `traverseAndCheck` to run in all builds, with significant performance degradation in entangled benchmarks. I cleaned up the header and definition a little here, too.
Clear candidates (suspects) in parallel: entanglement management perf improvement (and other fixes)
This fixes a subtle bug where, when scheduling a CGC, an unhandled exception can skip the cleanup code that happens after checking if the CGC-task can be popped and executed locally. In the scheduler, in `forkGC`, there is a call to `fork ... (f, g)` between the `push` and `popDiscard` for the CGC-task. Previously, if this call raised an exception, then the `popDiscard` (and other associated cleanup) was skipped. The solution is straightforward, similar to how exceptions are normally caught and re-raised across task boundaries: 1. catch the exception if needed (via `result (fn () => ...)`) 2. perform the cleanup 3. re-raise the exception if needed (via `extractResult`)
merge real.to_String changes
basis-library/util/one.sml defines a structure called `One` which is used in the basis library to optimize memory usage of a few functions, including: * Int.{fmt,toString} * Word.{fmt,toString} * Real.{split,toManExp} This patch fixes a buggy race condition in the implementation of `One`. With this patch, the above functions should be safe for parallelism and concurrency. The idea behind `One` is straightforward: a static buffer or mutable cell is allocated to be shared across calls. When a call is made, if the shared buffer is not in use, then the shared buffer can be claimed and used for the duration of that call, and then released. The mechanism for claiming the buffer (inherited from MLton) was previously not thread-safe, because it was not atomic at the hardware level. For MLton, it didn't need to be. But for MPL this is no longer correct, hence the bug. This patch switches to using an atomic compare-and-swap (CAS) to claim the buffer.
bugfix: update structure One to be thread-safe
Collecting a list of what we've done so far:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Working on a
v0.4
release which incorporates entanglement management (paper to appear at PLDI'23) as well as other improvements along the way. Details to follow...Here are some potential TODO items for v0.4. These aren't essential, but having the list is helpful regardless. We can discuss which we want to include and which we can leave for a future release.
Small things:
-disable-pass splitTypes1 -disable-pass splitTypes2
by default? IIRC, these passes haven't been updated for polymorphic CAS. (We should open an issue about this.)Big-ish things:
gdtoa
to be thread-safe #172 fixed theReal.toString
bug. We should also consider fixing similar bugs, e.g.Real.fromString
,Int.toString
, some of theTime.{to,from}X
functions, etc., all of which are inherited from MLton but which are not thread-safe by default.