123456789_123456789_123456789_123456789_123456789_

Class: Concurrent::Edge::LockFreeLinkedSet::Tail

Overview

Internal sentinel node for the Tail. It is always greater than all other nodes, and it is self-referential; meaning its successor is a self-loop.

Class Attribute Summary

Class Method Summary

Node - Inherited

Synchronization::Object - Inherited

.atomic_attribute?, .atomic_attributes,
.attr_atomic

Creates methods for reading and writing to a instance variable with volatile (Java) semantic as .attr_volatile does.

.attr_volatile

Creates methods for reading and writing (as attr_accessor does) to a instance variable with volatile (Java) semantic.

.ensure_safe_initialization_when_final_fields_are_present

For testing purposes, quite slow.

.new

Has to be called by children.

.safe_initialization!, .define_initialize_atomic_fields

Synchronization::AbstractObject - Inherited

Instance Attribute Summary

Node - Inherited

#last?

Check to see if the node is the last in the list.

Instance Method Summary

Node - Inherited

#<=>

We use Object#hash as a way to enforce ordering on the nodes.

#data, #key,
#key_for

This method provides a unqiue key for the data which will be used for ordering.

#next_node

Next node in the list.

#successor_reference

Synchronization::Object - Inherited

Synchronization::Volatile - Included

Synchronization::AbstractObject - Inherited

Constructor Details

.new(_data = nil, _succ = nil) ⇒ Tail

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb', line 60

def initialize(_data = nil, _succ = nil)
  @SuccessorReference = AtomicMarkableReference.new self
end

Instance Method Details

#<=>(_other)

Always greater than other nodes. This means that traversal will end at the tail node since we are comparing node size in the traversal.

[ GitHub ]

  
# File 'lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set/node.rb', line 66

def <=>(_other)
  1
end