Skip to content

Conversation

@gbaraldi
Copy link
Member

This just forward ports the workstealing PR to be on top of #56475 though that PR is a lot more mergeable than this one.


mutable struct Node{T}
const value::Union{T, Nothing}
@atomic next::Union{Node{T}, Nothing}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep this type stable by having next point to itself in case there is no next object.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd just replace the small union get_next(node) === nothing with a get_next(node) === node check everywhere though. Not sure it'd help performance, and it'd likely cause some annoying footguns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intent could at least be made clearer with a helper function hasnext(node) = get_next(node) != node.

# Weak Memory Models
# =======

module CLL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you update this with my bugfixes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I did. the x86 specific stuff was part of them but I also didn't test CLL too much (just that it built)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants