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

introduce waker and wait_queue abstractions. fixes #251, #259 #261

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

dmitryikh
Copy link

introduce waker and wait_queue abstractions. fixes #251, #259

* remove context::wait_hook_ and context::twstatus in flavor to waker_epoch_ and waker class
* this avoids data races in case of wait_until() operations, when the context
  could be timeouted and rescheduled on the other OS thread. In this case could
  be data races with context::wait_hook_ and inconsistences context::twstatus
  states.
* using context::waker_epoch_ introduces mechanism when the old wakers become
  outdated and waker::wake() is just no op. This fixes data races explained in
  the previous point
* fibers waiting queue with timeouts and notification mechanisms are incapsulated into
  wait_queue class. This introduce simple abstraction level to be used in
  different synchronization primitives
* the same wait_queue is used in context::wait_queue_ to synchronize fiber::join() operations

I know there is a huge diff!
But this PR could be good for simplification and improved stability (correctness) of boost::fiber library.
Let's discuss it!

Dmitry Khominich added 2 commits October 14, 2020 17:15
…torg#259

* remove context::wait_hook_ and context::twstatus in flavor to waker_epoch_ and waker class
* this avoids data races in case of wait_until() operations, when the context
  could be timeouted and rescheduled on the other OS thread. In this case could
  be data races with context::wait_hook_ and inconsistences context::twstatus
  states.
* using context::waker_epoch_ introduces mechanism when the old wakers become
  outdated and waker::wake() is just no op. This fixes data races explained in
  the previous point
* fibers waiting queue with timeouts and notification mechanisms are incapsulated into
  wait_queue class. This introduces simple abstraction level to be used in
  different synchronization primitives
* wait_queue is used in context::wait_queue_ to synchronize fiber::join() operations
@olk olk merged commit 3194349 into boostorg:develop Oct 14, 2020
@olk
Copy link
Member

olk commented Oct 14, 2020

verfy fine - ty Dmitry

@dmitryikh
Copy link
Author

@olk, I don't expected that the PR will be so fast adopted. I expected there should be code review. But I don't familiar with boost.org rules..

@olk
Copy link
Member

olk commented Oct 14, 2020

I've trust you - unfortunately I'm very busy and I've no time (but I looked at the changes in the PR).

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.

BOOT_ASSERT failure on Visual Studio Debug build (<boost>/lib/fiber/src/scheduler.cpp:406).
2 participants