Attempts to acquire a list of resources in a single C++ call, avoiding per-resource R-to-C++ round trips.
Usage
seize_all(
resources,
policy = "all_or_none",
amounts = NULL,
priorities = NULL,
force_unblock = FALSE,
accum_queue = TRUE
)Arguments
- resources
A list of
resource_discreteobjects.- policy
"all_or_none"(default) – acquires all only if all are available; queues for the first bottleneck without holding any others."sequential"– acquires in list order, holding partial acquisitions; user is responsible for avoiding deadlocks.- amounts
Integer vector of units per resource (default
1Lfor each).- priorities
Integer vector of priorities per resource (default
1L).- force_unblock
Logical (default
FALSE). WhenTRUEand all resources have sufficient capacity but the patient is not first in queue on some resources (deadlock), forcibly moves the patient to the front of those queues and acquires all resources. Has no effect when capacity is genuinely insufficient.- accum_queue
Logical (default
TRUE). WhenFALSEand the patient already has a queue entry on a bottleneck resource from a previous failed attempt, skips adding a new entry (existing entry serves). Prevents phantom queue accumulation on retries.
