This is doable with Julia 1.3 which I outlined here: Threading 1.3: Success Story
One issue at that time was that the @spawn
macro may run on thread 1 but there has been some recent work ([ANN] ThreadPools.jl - Improved thread management for background and nonuniform tasks) that should make this feasible.
Regarding the concrete implementation: I think it is sufficient that you use one BG thread that does the processing. This BG thread can update the UI using g_idle_add
. No need for an additional thread.