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 6387151
In Process

The Archive Base Latest Questions

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

I have checked different questions in this and in other forums, but I didn’t

  • 0

I have checked different questions in this and in other forums, but I didn’t find the solution to my problem.

I have an application which runs ffmpeg and exiftool processes. I have concurrency probles, and I would like to control them, using Thread. This is how I built it:

ExiftoolThread

public class ExiftoolThread extends Thread{

    String file;

    public ExiftoolThread(String file){
        this.file = file;
    }
     public void run(){
                serviceToExiftool(file);//Create metadata file
    }
}

FfmpegThread

public class FfmpegThread extends Thread{

    String itemName;

    public FfmpegThread(String itemName){
        this.itemName = itemName;
    }
     public void run(){
         serviceFFmpeg(itemName);//Create thumbnai froma  video
    }
}

Main call

Thread exiftoolThread = new ExiftoolThread(file.getName());
        exiftoolThread.run();
        try {
            exiftoolThread.join(3000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        log.write("JSON file created.It contains the metadata. ");


            Thread ffmpegThread = new FfmpegThread(itemName);
            ffmpegThread.run();
            try {
                ffmpegThread.join(3000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            log.write("Thumbnail created successfully. ");

After this call finishes, there are more actions working with the results of these processes, and there is always one of them which is missed. I guess that’s because one of them (exiftool or ffmpeg) finishes earlier and then the process continue before the other finishes.

I am using ffmpegThread.join(3000); to skip this problem, as the documentation says, this method waits untill the thread is died. What am I missing?

Thanks in advance

  • 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-25T03:06:57+00:00Added an answer on May 25, 2026 at 3:06 am

    You have to call start() to run the code in the new thread. Also, join() block the current thread, so you have to call it after you start all your thread.

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

Sidebar

Related Questions

I have checked this similar question, but the suggestions did not solve my problem:
I have checked several other questions on SO like this , this , this
I have checked many questions here but none has my answer. I appreciate if
I have checked the assembler options of GNU assembler as and I didn't find
I'm completely stumped with a problem using CoreLocation. I've checked out some other questions
I realize this is not terribly different from a lot of other questions that
question is bit different than other questions regarding this. I had a similar issue
I read all the other questions about this, but i can't understand why there
Ok, I've checked the other questions similar to this one, and none seem to
I have checked a lot of questions on stackoverflow and I seem to have

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.