A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Array.html below:

Class: Concurrent::Array — Concurrent Ruby

Class: Concurrent::Array
Inherits:
ArrayImplementation 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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4