Skip to content

DoubleFFT_1D creating non-daemon threads causes return from main() to wait #14

@daw3rd

Description

@daw3rd

I am doing the following (deep down in my main())

  DoubleFFT_1D doubleFFT = new DoubleFFT_1D(dataInWindow.length);
  double[] resultsFFT = Arrays.copyOf(dataInWindow, dataInWindow.length);
  doubleFFT.realForward(resultsFFT);

and when my main() returns it hangs for about 60 seconds before actually exiting the JVM. If I comment out the last line, the problem goes away. I think this is because ConcurrencyUtils uses Executors default thread factory which creates non-daemon threads.

    @Override
    public Thread newThread(Runnable r)
    {
        Thread t = DEFAULT_FACTORY.newThread(r);
        t.setUncaughtExceptionHandler(handler);
        return t;
    }

Should you be using daemon threads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions