Help for this page
my $head = 0; # Can only be modified by the lone writer thread my $tail = 0; # Can only be modified by the lone reader thread ... $head = ( $head + 1 ) % @buf; return 1; }
package Data::RingBuffer; ... $self->{head} = ( $self->{head} + 1 ) % @$buf; return 1; }