20#ifndef REALM_RSRV_IMPL_H
21#define REALM_RSRV_IMPL_H
36 struct LockTraceItem {
40 ACT_LOCAL_REQUEST = 0,
41 ACT_REMOTE_REQUEST = 1,
42 ACT_FORWARD_REQUEST = 2,
45 ACT_REMOTE_RELEASE = 5,
49 unsigned time_units, lock_id, owner, action;
63 void init(
ID _me,
unsigned _init_owner);
149 const void *data,
size_t datalen);
157 const void *data,
size_t datalen);
165 const void *data,
size_t datalen,
TimeLimit work_until);
174 const void *data,
size_t datalen);
static const Event NO_EVENT
The value should be usued to initialize an event handle. NO_EVENT is always in has triggered state .
Definition event.h:71
ID_Types
Definition id.h:250
@ ID_LOCK
Definition id.h:255
static ID make_reservation(unsigned creator_node, unsigned rsrv_idx)
::realm_id_t IDType
Definition id.h:32
Definition rsrv_impl.h:57
static ReservationImpl * first_free
Definition rsrv_impl.h:109
Mutex mutex
Definition rsrv_impl.h:83
bool is_locked(unsigned check_mode, bool excl_ok)
std::map< unsigned, LocalSharedInfo > local_shared
Definition rsrv_impl.h:99
void init(ID _me, unsigned _init_owner)
void release(TimeLimit work_until)
unsigned count
Definition rsrv_impl.h:73
Event acquire(unsigned new_mode, bool exclusive, AcquireType acquire_type, Event after_lock=Event::NO_EVENT)
@ ZERO_COUNT
Definition rsrv_impl.h:80
@ MODE_EXCL
Definition rsrv_impl.h:79
bool in_use
Definition rsrv_impl.h:75
EventWaiter::EventWaiterList WaiterList
Definition rsrv_impl.h:91
NodeSet remote_waiter_mask
Definition rsrv_impl.h:87
static Mutex freelist_mutex
Definition rsrv_impl.h:108
void release_reservation(void)
bool select_local_waiters(WaiterList &to_wake, Event &retry)
WaiterList local_excl_waiters
Definition rsrv_impl.h:93
std::map< unsigned, RetryInfo > retries
Definition rsrv_impl.h:105
NodeID owner
Definition rsrv_impl.h:72
static const ID::ID_Types ID_TYPE
Definition rsrv_impl.h:61
unsigned mode
Definition rsrv_impl.h:74
Reservation me
Definition rsrv_impl.h:71
NodeSet remote_sharer_mask
Definition rsrv_impl.h:87
static ID make_id(const ReservationImpl &dummy, int owner, ID::IDType index)
Definition rsrv_impl.h:65
bool requested
Definition rsrv_impl.h:106
AcquireType
Definition rsrv_impl.h:113
@ ACQUIRE_BLOCKING
Definition rsrv_impl.h:115
@ ACQUIRE_NONBLOCKING_PLACEHOLDER
Definition rsrv_impl.h:126
@ ACQUIRE_NONBLOCKING
Definition rsrv_impl.h:119
@ ACQUIRE_NONBLOCKING_RETRY
Definition rsrv_impl.h:122
ReservationImpl * next_free
Definition rsrv_impl.h:110
Definition reservation.h:30
bool use_fast_reservation_fallback
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition rsrv_impl.h:168
Reservation actual
Definition rsrv_impl.h:169
Event wait_on
Definition rsrv_impl.h:171
Reservation dummy
Definition rsrv_impl.h:170
static void handle_message(NodeID sender, const DestroyLockMessage &msg, const void *data, size_t datalen)
Definition rsrv_impl.h:160
static void handle_message(NodeID sender, const LockGrantMessage &msg, const void *data, size_t datalen, TimeLimit work_until)
Reservation lock
Definition rsrv_impl.h:161
unsigned mode
Definition rsrv_impl.h:162
Definition rsrv_impl.h:152
Reservation lock
Definition rsrv_impl.h:154
static void handle_message(NodeID sender, const LockReleaseMessage &msg, const void *data, size_t datalen)
NodeID node
Definition rsrv_impl.h:153
Definition rsrv_impl.h:143
Reservation lock
Definition rsrv_impl.h:145
NodeID node
Definition rsrv_impl.h:144
unsigned mode
Definition rsrv_impl.h:146
static void handle_message(NodeID sender, const LockRequestMessage &msg, const void *data, size_t datalen)
Definition rsrv_impl.h:95
unsigned count
Definition rsrv_impl.h:96
WaiterList waiters
Definition rsrv_impl.h:97
Definition rsrv_impl.h:101
unsigned count
Definition rsrv_impl.h:102
Event event
Definition rsrv_impl.h:103