input-output-hk / io-sim

Haskell's IO simulator which closely follows core packages (base, async, stm).
https://hackage.haskell.org/package/io-sim
Apache License 2.0
37 stars 15 forks source link

IOSim Timeouts API refactor and optimisation #9

Closed bolt12 closed 1 year ago

bolt12 commented 2 years ago

This is the same as in https://github.com/input-output-hk/ouroboros-network/pull/3682 but on the new repository

Resolves input-output-hk/ouroboros-network#3672

bolt12 commented 2 years ago

NOTE that https://github.com/input-output-hk/ouroboros-network/pull/3682 had 1 more commit that fixed a KeepAlive convergence test. I am going to add that as a separate PR over at ouroboros-network.

coot commented 2 years ago

Can we turn this PR into a draft, we need to do the IOSimPOR side before merging, isn't it?

bolt12 commented 2 years ago

closes https://github.com/input-output-hk/ouroboros-network/issues/3672

coot commented 2 years ago

Lets consider two concurrent threads which are blocked on threadDealy, which expires at the same time. We don't need to race the two events because there's nothing racy on its own here, if the two threads do something later that introduces a race that race can be inverted. Even if we deschedule the thread just after a timer delay expires (and thus we start a new step), this will not influence the ability to invert the following racing steps.

bolt12 commented 1 year ago

I removed the refactor commits and move those to #47