think²

  • Archive
  • RSS
  • Ask me anything

How to Become a Great Finisher

  • 7 months ago
  • Permalink
  • Share
    Tweet

Load Avarage

    • #linux
    • #unix
    • #cpu
    • #load
    • #top
  • 1 year ago
  • Permalink
  • Share
    Tweet

An Interview With Edsger W. Dijkstra

    • #programming
    • #history
    • #algorithms
    • #dijkstra
  • 1 year ago
  • Permalink
  • Share
    Tweet

How To Focus

  • 1 year ago
  • Permalink
  • Share
    Tweet

The Cure for Creative Blocks

  • 1 year ago
  • Permalink
  • Share
    Tweet
Sri Lanka’s Greatest Cricketer
Pop-upView Separately

Sri Lanka’s Greatest Cricketer

    • #murali
    • #sri lanka
    • #cricket
  • 1 year ago
  • Permalink
  • Share
    Tweet

Java CopyOnWriteArrayList

The CopyOnWriteArrayList class is intended as a replacement for ArrayList in concurrent applications where traversals greatly outnumber insertions or removals. This is quite common when ArrayList is used to store a list of listeners, such as in AWT or Swing applications, or in JavaBean classes in general. (The related CopyOnWriteArraySet uses aCopyOnWriteArrayList to implement the Set interface.)

If you are using an ordinary ArrayList to store a list of listeners, as long as the list remains mutable and may be accessed by multiple threads, you must either lock the entire list during iteration or clone it before iteration, both of which have a significant cost. CopyOnWriteArrayList instead creates a fresh copy of the list whenever a mutative operation is performed, and its iterators are guaranteed to return the state of the list at the time the iterator was constructed and not throw aConcurrentModificationException. It is not necessary to clone the list before iteration or lock it during iteration because the copy of the list that the iterator sees will not change. In other words, CopyOnWriteArrayList contains a mutable reference to an immutable array, so as long as that reference is held fixed, you get all the thread-safety benefits of immutability without the need for locking.

For more information please refer “Java theory and practice: Concurrent collections classes”.

    • #java
    • #concurrency
  • 1 year ago
  • Permalink
  • Share
    Tweet

Websocket support for Django

    • #python
    • #django
    • #websocket
  • 1 year ago
  • Permalink
  • Share
    Tweet
bpython is a fancy interface to the Python interpreter for Unix-like operating systems.
Pop-upView Separately

bpython is a fancy interface to the Python interpreter for Unix-like operating systems.

    • #bpython
    • #python
    • #interpreter
  • 1 year ago
  • Permalink
  • Share
    Tweet

Amazing physics engine

    • #physiscs
    • #engine
    • #gaming
  • 1 year ago
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 1 of 14

About

Never be afraid to sit awhile and think. You and I are not what we eat; we are what we think.
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr