arraylist « concurrency « Java Thread Q&A

Home
Java Thread Q&A
1.concurrency
2.Development
3.Exception
4.Notify
5.Operation
6.Socket
7.State
8.synchronize
9.Thread Safe
10.ThreadPool
Java Thread Q&A » concurrency » arraylist 

1. Java concurrency iterator arraylist shenanigans    stackoverflow.com

I have some code that uses an iterator to traverse an arraylist. If a certain condition is met, I want to add an object to the arraylist. Can this be done ...

2. Java arraylist (or something like arraylist) concurrent read and set    stackoverflow.com

In Java, if multiple thread read values in an java.util.ArrayList and one of them may set an entry by calling ArrayList.set(index, newVal) is that going to work? (i'll explain what I ...

3. Why does unsynchronization make ArrayList faster and less secure?    stackoverflow.com

I read the following statement:

ArrayLists are unsynchronized and therefore faster than Vector, but less secure in a multithreaded environment.
I would like to know why unsynchronization can ...

4. alternative to CopyOnWriteArrayList for frequent writes, occasional iterating    stackoverflow.com

I have an ArrayList that is to be cached and shared across multiple threads indefinitely. Operations include frequent adds and removes, plus occasional iterating over it. The ArrayList lives in a wrapper ...

5. Java ArrayList concurrent modification    stackoverflow.com

i'm getting some problem to get this work well as i aspect:

    for(Iterator<Object> i = mylist.iterator(); i.hasNext();) {
        Object obj = ...

6. ArrayList concurrent use of add and remove    forums.oracle.com

Hi I am using an ArrayList to collect monitoring information for a web service. Each time the web service is called the time that it took to process is added to the ArrayList. The web service calls can be concurrent. Every 5 minutes the ArrayList is cleared (via clear()). I know that any structural changes to an ArrayList should be synchronized, ...

7. Safe to Access ArrayList? - Using 2 threads, But not concurrent    forums.oracle.com

If you're open for Java language details like this, I'd expect you to be going of the JLS and the memory model to solve "problems" like these. JLS 3rd Ed. Section 17.4.4 and 17.4.5 are applicable, taking: The final action in a thread T1 synchronizes-with any action in another thread T2 that detects that T1 has terminated. T2 may accomplish this ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.