Skip to content

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

Description

@Enchufa2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions