Skip to content
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

Few improvements #186

Merged
merged 4 commits into from
Aug 6, 2022
Merged

Few improvements #186

merged 4 commits into from
Aug 6, 2022

Conversation

MBkkt
Copy link
Member

@MBkkt MBkkt commented Aug 6, 2022

Purpose

Few fixes for coroutine:

  • Add return_value(FutureBase<V, E>&& f), that allow to return value from future with same type as coroutine more free than co_return co_await f;
  • Add return_value(StopTag) for cancel coroutine Future from function/Promise side
  • Add ability to return error or result from coroutine Future
  • Replace return_void with return_value(Unit) and co_return; with co_return {}; for allow use other return_value(...) in void coroutine

Fix BaseCore possible bug with incorrect static_cast ...

Few wait* fixes:

  • Remove WaitGroup and AwaitGroup duplication
  • Make WaitGroup and OneShotEvent better
  • Make Wait single Future faster

Related Information

  • Design document: ...
  • Bench PR: ...

Testing

  • This change is a trivial rework or code cleanup without any test coverage.
  • This change is already covered by existing tests.
  • This PR adds tests that were used to verify all changes.
  • There are tests in an external testing repository: ...

* Add return_value(FutureBase<V, E>&& f), that allow to return value from future with same type as coroutine more free than co_return co_await f;
* Add return_value(StopTag) for cancel coroutine Future from function/Promise side
* Add ability to return error or result from coroutine Future
* Replace return_void with return_value(Unit) and co_return; with co_return {}; for allow use other return_value(...) in void coroutine
* Remove WaitGroup and AwaitGroup duplication
* Make WaitGroup and OneShotEvent better
* Make Wait single Future faster
@MBkkt MBkkt requested a review from kononovk as a code owner August 6, 2022 13:58
kononovk
kononovk previously approved these changes Aug 6, 2022
test/unit/not_implemented.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
test/unit/not_implemented.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
test/unit/coroutine/await_group.cpp Outdated Show resolved Hide resolved
src/util/mutex_event.cpp Show resolved Hide resolved
include/yaclib/coroutine/detail/await_group_impl.hpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 6, 2022

Codecov Report

Merging #186 (d7ac8c2) into main (59a17ae) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #186   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           60        55    -5     
  Lines         1361      1303   -58     
=========================================
- Hits          1361      1303   -58     
Impacted Files Coverage Δ
include/yaclib/algo/detail/when_all_impl.hpp 100.00% <ø> (ø)
include/yaclib/async/promise.hpp 100.00% <ø> (ø)
include/yaclib/coroutine/async_mutex.hpp 100.00% <ø> (ø)
include/yaclib/util/detail/mutex_event.hpp 100.00% <ø> (ø)
include/yaclib/algo/detail/wait_impl.hpp 100.00% <100.00%> (ø)
include/yaclib/algo/one_shot_event.hpp 100.00% <100.00%> (ø)
include/yaclib/algo/wait_group.hpp 100.00% <100.00%> (ø)
include/yaclib/async/detail/base_core.hpp 100.00% <100.00%> (ø)
include/yaclib/async/detail/core.hpp 100.00% <100.00%> (ø)
include/yaclib/async/detail/future_impl.hpp 100.00% <100.00%> (ø)
... and 14 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@MBkkt MBkkt changed the title Add task2 rebase Few improvements Aug 6, 2022
@MBkkt MBkkt self-assigned this Aug 6, 2022
@MBkkt MBkkt added performance Improve performance refactoring Refactoring labels Aug 6, 2022
@MBkkt MBkkt added this to the Release 2022.09.01 milestone Aug 6, 2022
@MBkkt MBkkt requested a review from kononovk August 6, 2022 16:16
@MBkkt MBkkt force-pushed the add-task2-rebase branch 3 times, most recently from 79b72cb to b9d9891 Compare August 6, 2022 20:23
@MBkkt MBkkt merged commit 27711d0 into main Aug 6, 2022
@MBkkt MBkkt deleted the add-task2-rebase branch September 18, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Improve performance refactoring Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants