Class: Concurrent::Array

Inherits:
ArrayImplementation
  • Object
show all
Defined in:
lib/concurrent-ruby/concurrent/array.rb

Overview

Note:

a += b is not a thread-safe operation on Concurrent::Array. It reads array a, then it creates new Concurrent::Array which is concatenation of a and b, then it writes the concatenation to a. The read and write are independent operations they do not form a single atomic operation therefore when two += operations are executed concurrently updates may be lost. Use #concat instead.

A thread-safe subclass of Array. This version locks against the object itself for every method call, ensuring only one thread can be reading or writing at a time. This includes iteration methods like #each.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy