# How to run a HTTP.jl server in parallel, while doing computations in the foreground?

**URL:** https://discourse.julialang.org/t/how-to-run-a-http-jl-server-in-parallel-while-doing-computations-in-the-foreground/101889
**Category:** General Usage
**Tags:** multithreading, server, httpjl
**Created:** [July 21, 2023, 1:57pm UTC](https://discourse.julialang.org/t/how-to-run-a-http-jl-server-in-parallel-while-doing-computations-in-the-foreground/101889 "2023-07-21T13:57:31Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![algunion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/algunion/32/51630_2.png) [@algunion](https://discourse.julialang.org/u/algunion)
#### Post date: [July 21, 2023, 9:16pm UTC](https://discourse.julialang.org/t/how-to-run-a-http-jl-server-in-parallel-while-doing-computations-in-the-foreground/101889/7 "2023-07-21T21:16:59Z")

</div>

I created a related topic here - as this doesn’t seem related to `HTTP.jl` package:

> [@Bug in sleep() function - main thread work affecting sleep duration on running tasks](https://discourse.julialang.org/t/communication-between-tasks-dependent-on-free-main-thread/101911):
>
> What triggered the present experiment was my failure to find a reasonable solution for the issue raised by [this topic](https://discourse.julialang.org/t/how-to-run-a-http-jl-server-in-parallel-while-doing-computations-in-the-foreground/101889). It turned out that the issue was unrelated to the HTTP.jl package and went deeper. Now, the experiment (with nthreads() \> 2). Important note: to avoid “what if” scenarios about the resource allocation to the running tasks when using 1-2 threads, I suggest running this with -t 3 or above. Also, for this MWE it doesn’t make any difference if the tasks are spawned on :interactiv…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-run-a-http-jl-server-in-parallel-while-doing-computations-in-the-foreground/101889)._
