# With julia-1.9, should the main task block :interactive tasks?

**URL:** <https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809>\
**Category:** General Usage\
**Created:** [January 11, 2023, 3:27pm UTC](https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809 "2023-01-11T15:27:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![samtkaplan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samtkaplan/32/2000_2.png) [@samtkaplan](https://discourse.julialang.org/u/samtkaplan)\
**Post date:** [September 12, 2023, 6:44pm UTC](https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809/2 "2023-09-12T18:44:29Z")

</div>

Sorry for reviving this older thread, but I have the same question. Here’s another similar/same example where julia is started with `julia -t 1,1`, and the method “bar” blocks the method “foo”, which is not what I expected. This is with Julia 1.9.3.

```julia
function foo()
    x = 0
    tic = time()
    while true
        if time() - tic > 30
            break
        end
        println("inside interactive loop, x=$x")
        x += 1
        sleep(1)
    end
end

function bar()
    x = 1
    c = -1
    d = 3
    tic = time()
    while true
        if time() - tic > 30
            break
        end
        x += c/d
        c *= -1
        d += 2
    end
    @info "bar, after 30 seconds, pi is $(4*x)"
end

tsk = Threads.@spawn :interactive foo()
bar()
wait(tsk)

```

output:

```julia
[ Info: bar, after 30 seconds, pi is 3.1415926521589954
inside interactive loop, x=0
inside interactive loop, x=1
inside interactive loop, x=2
inside interactive loop, x=3
inside interactive loop, x=4
inside interactive loop, x=5
inside interactive loop, x=6
inside interactive loop, x=7
inside interactive loop, x=8
inside interactive loop, x=9
inside interactive loop, x=10
inside interactive loop, x=11
inside interactive loop, x=12
inside interactive loop, x=13
inside interactive loop, x=14
inside interactive loop, x=15
inside interactive loop, x=16
inside interactive loop, x=17
inside interactive loop, x=18
inside interactive loop, x=19
inside interactive loop, x=20
inside interactive loop, x=21
inside interactive loop, x=22
inside interactive loop, x=23
inside interactive loop, x=24
inside interactive loop, x=25
inside interactive loop, x=26
inside interactive loop, x=27
inside interactive loop, x=28
inside interactive loop, x=29

```

---

_[View the full topic](https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809)._
