// // Represents a piece of committed memory. // // Use acquire() and/or try_acquire() for exclusive access // to the buffer (cas identity). This is a precondition // for attempting stores. // // u1* _pos <-- last committed position // u1* _top <-- next unflushed position // // Stores must uphold transactional semantics. This means that _pos // must be updated only after all intended stores have completed already. // The relation between _pos and _top must hold atomically, // e.g. the delta must always be fully parsable. // _top can move concurrently by other threads but is always <= _pos. // // The _flags field holds generic tags applicable to all subsystems. // // The _context field can be used to set subsystem specific tags onto a buffer. // // Memory ordering: // // Method Owner thread Other threads // --------------------------------------------------------------- // acquire() Acquire semantics (cas) Acquire semantics (cas) // try_acquire() Acquire semantics (cas) Acquire semantics (cas) // release() Release semantics Release semantics // pos() Plain load Acquire semantics needed at call sites // set_pos() Release semantics N/A // top() Acquire semantics Acquire semantics // set_top() Release semantics Release semantics // acquire_crit_sec_top() Acquire semantics (cas) Acquire semantics (cas) // release_crit_sec_top() Release semantics Release semantics //
class JfrBuffer { public:
JfrBuffer* _next; // list support private: constvoid* _identity;
u1* _pos; mutableconst u1* _top;
size_t _size;
u2 _header_size;
u1 _flags;
u1 _context;
LP64_ONLY(const u4 _pad;)
// If pos() methods are invoked by a thread that is not the owner, // then acquire semantics must be ensured at the call site. const u1* pos() const { return _pos;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.