Skip to content

Comments

Add cancellation support#402

Merged
ChuanqiXu9 merged 8 commits intoalibaba:mainfrom
poor-circle:cancel_expermential
Jan 14, 2025
Merged

Add cancellation support#402
ChuanqiXu9 merged 8 commits intoalibaba:mainfrom
poor-circle:cancel_expermential

Conversation

@poor-circle
Copy link
Collaborator

@poor-circle poor-circle commented Nov 15, 2024

Why

See document

What is changing

Breakchanges:

  1. Components such as Yield and spinlock may throw exceptions.
  2. The return values of CollectAll/CollectAny have been changed to lazy, and the callback versions of collectAll/collectAny have been removed.

@poor-circle poor-circle changed the title Add cancellation support. Add cancellation support Nov 15, 2024
@poor-circle poor-circle force-pushed the cancel_expermential branch 3 times, most recently from 1bf6f5a to 77c1a8d Compare November 26, 2024 13:53
@CLAassistant
Copy link

CLAassistant commented Jan 9, 2025

CLA assistant check
All committers have signed the CLA.

@poor-circle
Copy link
Collaborator Author

@ChuanqiXu9 It seems that mac ci & bazel ci are broken.

@ChuanqiXu9
Copy link
Collaborator

@ChuanqiXu9 It seems that mac ci & bazel ci are broken.

CC @PikachuHyA

@poor-circle
Copy link
Collaborator Author

@ChuanqiXu9 All conversation resolved.

virtual ~Signal();

private:
std::atomic<uint64_t> _state;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the intialization? And what's the meaning of _state? The latt emitted signal type? Can a Signal emit multiple times?

Copy link
Collaborator Author

@poor-circle poor-circle Jan 13, 2025

Choose a reason for hiding this comment

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

Default state is zero. It means which signal has triggered. It was updated at UpdateState. If a signal is low 32bits, it can't emit multiple times. I have add some comments.

std::atomic<Node*> _slotsHead;
};

class Slot {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not resolved.

syncAwait(testCollectAllPara().via(&e1));
}

TEST_F(LazyTest, testCollectAnyWithCallbackVariadic) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please not touch the previous test if the API remains

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we remain the test?

@poor-circle
Copy link
Collaborator Author

@ChuanqiXu9 new conversation is fixed

@ChuanqiXu9 ChuanqiXu9 merged commit 480f692 into alibaba:main Jan 14, 2025
14 checks passed
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.

3 participants