Results 1 to 2 of 2
  1. #1
    flok is offline Member
    Join Date
    Sep 2009
    Location
    Gouda, the Netherlands
    Posts
    24
    Rep Power
    0

    Default RCU in Java? or some list/set/etc. which can handle concurrent access?

    Hi,

    Does Java have some kind of RCU (read-copy-update) mechanism for sets/lists?

    What I would like to do is: I have a list of objects that multiple threads can work on. When they're finished, they should remove the object from the list (or the master thread should do it, doesn't matter for now). But also they should fetch a new work-object from that array as well as add new ones.
    An option could be add a single lock to the whole list for all read/write access but it is possible that the processingtime of a batch of work-objects is that short that lock-contention would happen constantly. And with enough processors (and thus threads) this lock contention is bound to happen.

    So, anyone got a suggestion how to solve this?

    Thank you.

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    or use a java.util.concurrent list of your choice. :)
    My Hobby Project: LegacyClone

Similar Threads

  1. java.lang.NoClassDefFound --Any way to handle this
    By sunny_sykes in forum Advanced Java
    Replies: 1
    Last Post: 03-30-2009, 08:29 AM
  2. To access hotmail contact list using java
    By bharat_kasodariya in forum Advanced Java
    Replies: 1
    Last Post: 02-26-2009, 02:06 PM
  3. FileLock and file access from concurrent threads..
    By fxRichard in forum Advanced Java
    Replies: 5
    Last Post: 01-02-2009, 08:08 PM
  4. How to access ArrayList in List of List?
    By alvations in forum New To Java
    Replies: 5
    Last Post: 10-08-2008, 12:23 PM
  5. Replies: 1
    Last Post: 06-07-2007, 05:29 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •