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

  • SEARCH
  • Home
  • 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 941337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:06:16+00:00 2026-05-15T22:06:16+00:00

I have written an image processing application with the GUI part written in Java

  • 0

I have written an image processing application with the GUI part written in Java and the number crunching part is written in C and is called via JNI.

My problem is that it takes 20 – 30 seconds for the application to process an image, and during this time the application disappears from the Task Switcher (the Alt-Tab thingy) and it is not possible to move the application’s window to the front (this is my main concern). It is still possible to bring the application to front via the task bar.

Some more info:

  • The application isn’t stuck or anything, I can see that it updates a progress bar as expected.
  • When the calculation is done, the application will show up the Task Switcher and can become the top window again. If I start a new calculation the application will disappear from the Task Switcher again.
  • The JNI call is made on a separate thread (from EDT), I have tried both the main thread and a created thread.
  • The EDT is not blocked. I have added printfs in WindowListener’s and WindowFocusListener’s methods and if the window lose focus the appropriate methods are called.
  • On Mac OS X the application works without problem.
  • This is on Java 1.6 on Windows 2003 Server.
  • First I thought that it was openMP that was doing something nasty with the threads, but turning it off didn’t make any difference.
  • The JNI lib is compiled with MinGW 4.5.

It seems to me that Windows expects that an application answer/send some requests or else it will be thrown out of the Task Switcher. But I don’t even know enough about Windows programming to even be able to google for an answer. Can someone give me some pointers?

  • 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-15T22:06:17+00:00Added an answer on May 15, 2026 at 10:06 pm

    I hate to say this as an answer, but are you sure that the number crunching is happening on a separate thread from the EDT? Because seriously, it shouldn’t be behaving this way at all. There’s a logical reason for it, I’m sure, and the most obvious is, you’re blocking the EDT while you number crunch.

    Maybe you think you’re creating a new thread, but you’re not?

    Runnable r = new Runnable() {
      public void run() {
         ClassName.this.executeJNI();
      }
    };
    new Thread(r).start();
    

    Either that, or something in the number crunching is locking a resource that the EDT thread needs – but I don’t even know what this could possibly look like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application written in C that captures an image via webcam,does some
I have a C++ Win32 application that was written as a Windows GUI project,
I'm currenty writing small application for image processing. However I have a big problem
So I have some cool Image Processing algorithm. I have written it in OCaml.
I have written an application in which I want to convert a .jpg image
I have written code in Java to access web cam,and to save image... I
I have written a procedure that shows me the image path from picture table
I have written a jQuery image resize script that works fine when the images
I have written a CGI script that creates an image dynamically using GET data.
I have written an activity that has 2 image buttons (1 for messaging and

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.