Clojure

Transient collections should guarantee thread visibility

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.7
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Ok

Description

With changes from CLJ-1498, transients are still thread isolated but may move between threads during their lifetime which introduces new concurrency concerns, namely visibility of changes across threads.

Approach: Make all transient collection fields either final or volatile to ensure visibility across threads.

Patch: clj-1580-2.patch

Screened by:

  1. clj-1580.patch
    17/Dec/14 4:10 PM
    2 kB
    Alex Miller
  2. clj-1580-2.patch
    02/Jan/15 11:57 AM
    3 kB
    Alex Miller

Activity

Hide
Stuart Halloway added a comment -

Should ATtransientSet.impl be volatile also?

Show
Stuart Halloway added a comment - Should ATtransientSet.impl be volatile also?
Hide
Alex Miller added a comment -

Added -2 patch that makes ATransientSet.impl volatile.

Show
Alex Miller added a comment - Added -2 patch that makes ATransientSet.impl volatile.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: