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

Issue with preemption + signal handling at the same time #187

Closed
Enchufa2 opened this Issue Feb 11, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@Enchufa2
Copy link
Member

Enchufa2 commented Feb 11, 2019

Example:

library(simmer)

new_timeout <- trajectory() %>%
  log_("new timeout") %>%
  timeout(1)

customer <- trajectory() %>%
  seize("res") %>%
  trap("signal", new_timeout) %>%
  timeout(5) %>%
  log_("releasing") %>%
  release("res")

blocker <- trajectory() %>%
  send("signal") %>%
  log_("blocking the resource") %>%
  seize("res") %>%
  timeout(20) %>%
  log_("opening the resource") %>%
  release("res")

env <- simmer() %>%
  add_resource("res", preemptive=TRUE) %>%
  add_generator("customer", customer, at(0)) %>%
  add_generator("blocker", blocker, at(2), priority=10) %>%
  run()
#> 2: blocker0: blocking the resource
#> 22: blocker0: opening the resource
#> 20: customer0: new timeout
#> 21: customer0: releasing

Time goes backwards.

@Enchufa2 Enchufa2 added the bug label Feb 11, 2019

@Enchufa2 Enchufa2 closed this in c14278f Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.