Closed grv07 closed 3 years ago
Hello, I have added a test case for the wait function of the write handler.
This test checks a case where one of the readers is still reading and the hander calls the wait fn. I try to simulate the read handle behaviour by creating a new thread that will increase the epoch by one when scheduled. Thanks.
Hmm, I don't think this test does quite what you want it to. In particular, the thread that increments may end up running before wait
is even called, in which case wait
won't wait at all. There isn't really a good way to fix that problem except by creating a loom
test to test both interleavings, which I know is something @mlodato517 was looking at a little while back.
Yes, I understand your point.
Apart from loom
, do you think park_timeout
will be good fit for this problem ?
park_timeout
could work too! You'd probably want to first park_timeout
without the reader allowing the writer to make progress, check that the writer did in fact not make progress, then park
, then progress the reader, and then check that the writer was then unblocked.
I think we're almost there now!
Oh, and if you can merge from master
, we should get CI testing and coverage analysis for this PR too!
Merging #90 (c15ac06) into master (89d973a) will increase coverage by
5.86%
. The diff coverage is100.00%
.
Impacted Files | Coverage Δ | |
---|---|---|
src/write.rs | 86.25% <100.00%> (+6.86%) |
:arrow_up: |
Awesome, thank you for sticking with it!
This change is