You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I got it wrong in my last comment. Using take() blocks here, but doesn't that mean it will continue to block until a change happens? Meaning if no change happens it will block indefinitely? How will it be interrupted? (Note that poll() would be a solution, but we would want to avoid a busy-wait with that approach. Maybe a better approach would be to interrupt directly, but I'm not sure how that is accomplished with coroutines.)
hansenc
changed the title
Busy-waittake() blocks indefinitely
Oct 2, 2019
hansenc
changed the title
take() blocks indefinitely
take() blocks indefinitely
Oct 2, 2019
It looks like the core loop is using up a lot more CPU than it should due to a busy-wait, correct? Would it be better to sleep between iterations?
Btw, thanks for the blog post and
WatchService
example! Even though I don't know Kotlin, I found it easy to follow.The text was updated successfully, but these errors were encountered: