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

Move registerDelay in MonadConc? #387

Open
NicolasT opened this issue Apr 15, 2023 · 0 comments
Open

Move registerDelay in MonadConc? #387

NicolasT opened this issue Apr 15, 2023 · 0 comments

Comments

@NicolasT
Copy link

Currently, registerDelay is implemented in function of what's provided by MonadConc, forking a thread. This works, but the registerDelay implementation from GHC/stm is quite different: it schedules something in the runtime's timer manager to get things done at some future point in time, removing the need for a thread.

Would it make sense to have registerDelay in MonadConc so the IO instance can use the one from stm, and Program the current implementation (using a thread)? Operationally, both should be the same (otherwise the registerDelay in concurrency wouldn't be interchangable with the one from stm in the first place...), so tests using DejaFu should still find bugs, even when in IO another implementation is used.

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

No branches or pull requests

1 participant