Merged
Conversation
* remove `std.atomic.Ordering`
- it is provided by the language with `std.builtin.AtomicOrder`.
* remove `std.atomic.fence`
- it is provided by the language with `@fence`.
* remove `std.atomic.compilerFence`
- if this is desired, it should be a language feature, not a standard
library function with inline asm.
This was originally supposed to be a lock-free stack, but I gave up on that and made it be a thread-safe stack which is implemented poorly using spin locks. Nobody should use this data structure. The alternative is a normal stack protected by a mutex.
This was originally supposed to be a lock-free queue, but I gave up on that and made it be a thread-safe queue instead. Putting the mutex directly inside the queue data structure makes it non-composeable. Instead, the recommendation is to use a normal queue protected by an external mutex.
* move std.atomic.Atomic to std.atomic.Value * fix incorrect argument order passed to testing.expectEqual * make the functions be a thin wrapper over the atomic builtins and stick to the naming conventions. * remove pointless functions loadUnchecked and storeUnchecked. Instead, name the field `raw` instead of `value` (which is redundant with the type name). * simplify the tests by not passing every possible combination. Many cases were iterating over every possible combinations but then not even using the for loop element value! * remove the redundant compile errors which are already implemented by the language itself. * remove dead x86 inline assembly. this should be implemented in the language if at all.
Contributor
|
why remove Queue and Stack? |
Member
Author
|
Have a look at the respective commit messages |
Contributor
|
sorry, didnt think to check that |
kprotty
reviewed
Nov 23, 2023
| return @atomicRmw(T, &self.raw, .Xchg, operand, order); | ||
| } | ||
|
|
||
| pub inline fn cmpxchgWeak( |
Contributor
There was a problem hiding this comment.
Given this was renamed to the builtin, why not rename swap as well?
llogick
added a commit
to zigtools/zls
that referenced
this pull request
Nov 26, 2023
* zig std had removed meta.trait ps: this change need set minimum zig build version to 0.12.0-dev.1686+d5e21a4f1 * std.fs: split Dir into IterableDir ziglang/zig#12060 * rework std.atomic ziglang/zig#18085 * set minimum build version to 0.12.0-dev.1710+2bffd8101 * Update binned_allocator.zig * build.zig.zon: Update `known-folders` --------- Co-authored-by: nullptrdevs <16590917+nullptrdevs@users.noreply.github.com>
Contributor
|
for when the time comes, this broke |
Member
Author
|
yeah I know. the event loop needs to be completely rewritten. |
This file contains hidden or 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
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.
std.atomic.Orderingstd.builtin.AtomicOrder.std.atomic.fence@fence.std.atomic.compilerFencelibrary function with inline asm.
stick to the naming conventions.
name the field
rawinstead ofvalue(which is redundant with thetype name).
cases were iterating over every possible combinations but then not
even using the for loop element value!
the language itself.
language if at all.