# Calling Julia functions from a multi-threading scheduler written in C?

**URL:** <https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114>\
**Category:** General Usage\
**Tags:** question, multithreading, c\
**Created:** [January 28, 2021, 12:11pm UTC](https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114 "2021-01-28T12:11:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 28, 2021, 1:16pm UTC](https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114/2 "2021-01-28T13:16:18Z")

</div>

> [@stustd](#):
>
> The Julia reactor state should have one field holding a reference to a Julia interpreter engine;

As far as I know, embedding multiple instances of Julia (which uses a compiler, not just an interpreter) within a single process is not supported, and perhaps will never be supported. See [this thread from 2014](http://julia-programming-language.2336112.n4.nabble.com/Distinguish-between-modules-when-embedding-Julia-in-C-td507.html).

The best approach is probably to let Julia “drive” — Julia already has a scheduler for multi-threaded code, so you could spawn Julia threads that call your C functions and pass them callback functions.

---

_[View the full topic](https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114)._
