Skip to content

How to interrupt queued threads? #26

@sairus7

Description

@sairus7

I've run the following code to process a batch of files in external program:

ThreadPools.@qthreads for i in 1:length(filelist)
    try
        file = filelist[i]
        run(`some external command on $file`)
    catch err
        @error err #if some task fails, we just log it and continue to the next one
    end
end

The whole process lasts for a coule of hours, but when I tried to cancel execution, I could not do it.
Then I exited Julia console, but my machine continued to execute 8 external processes in parallel. When I manually kill a process, it drops CPU usage to zero for a short time, and then continues to work (seems like sheduler just starts the next item).
Finally, had to restart my machine to stop it.

So, how should I interrupt queued 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