Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:25:06+00:00 2026-05-31T05:25:06+00:00

I have a Java application that is performing some realtime image processing, with the

  • 0

I have a Java application that is performing some realtime image processing, with the image data stored in large int arrays.

Updates to parts of the image array are happening constantly from multiple threads (this is basically for visualisation of a very high volume stream of incoming events).

Readers need to take copies of parts of the image array for display and/or further processing.

Because of the need for high throughput, I want to avoid any expensive synchronisation to handle the concurrent access. In addition, occasional small visual errors can be tolerated, e.g. if a reader copies a section of the image that has only been partially updated for a given incoming event. Basically what I want to do is relax thread safety to ensure maximum throughput.

Is this approach going to work? Any gotchas I should be aware of?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:25:06+00:00Added an answer on May 31, 2026 at 5:25 am

    Presumably you are proposing to partition the array and allow only a single thread to access each partition. This is a reasonable approach without issue.

    In fact the fork/join framework does this and may be applicable to what you are trying to acheive.

    e.g. Look at the javadocs for java.util.concurrent.RecursiveAction which shows an example of partitioning an array to sort it. In a nutshell the array is partitioned until the partition size is below a threshold. Each of the subsequent partitions are then partitioned again (ie. recursively).

    Code looks like this:

     class SortTask extends RecursiveAction {
        final long[] array; final int lo; final int hi;
        SortTask(long[] array, int lo, int hi) {
        this.array = array; this.lo = lo; this.hi = hi;
     }
    
     protected void compute() {
        if (hi - lo < THRESHOLD)
           sequentiallySort(array, lo, hi);
        else {
           int mid = (lo + hi) >>> 1;
           invokeAll(new SortTask(array, lo, mid),
                     new SortTask(array, mid, hi));
           merge(array, lo, hi);
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java application that stores some GPS data in a strange format:
I have a Java application that makes heavy use of a large file, to
I have a Java application that needs to collect and report a large number
I have made a java application that stores data from a .csv file to
I have built a Java application that has some dependencies (~10). I would like
I have Java Desktop application that displays some information in a JTable that contains
I have Java Desktop application that displays some information in a JTable that may
I have a java application that runs out of memory, but I have no
I have a Java application that is managed using Maven. The project involves the
i have an Java J2ME application that does (at user request) create HttpConnections to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.