# Based on which packages is Base.Threads built?

**URL:** https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930
**Category:** Performance
**Tags:** question
**Created:** [February 2, 2023, 2:48pm UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930 "2023-02-02T14:48:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)
#### Post date: [February 2, 2023, 2:48pm UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930/1 "2023-02-02T14:48:02Z")

</div>

I am happy to use the functions in `Base.Threads`, and I am carious to know that based on which packages this `Base.Threads` is built? is it `OneAPI`, `OpenMP`, etc.?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [February 2, 2023, 5:59pm UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930/2 "2023-02-02T17:59:46Z")

</div>

It’s not build on high-level threading frameworks. It uses `libuv`’s threading APIs, which are thin wrappers around OS native thread APIs; elsewhere it uses some pthreads functions directly on UNIX systems and corresponding Windows threading APIs on Windows.

---

<div class="post-metadata">

### Author: ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)
#### Post date: [February 2, 2023, 6:06pm UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930/3 "2023-02-02T18:06:10Z")

</div>

> [@StefanKarpinski](#):
>
> elsewhere it uses some pthreads functions directly on UNIX systems and corresponding Windows threading APIs on Windows

Thanks for your reply.  
For curiosity, could you please give me a link to the library of those `pthreads functions`?

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [February 3, 2023, 3:32am UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930/4 "2023-02-03T03:32:56Z")

</div>

Grep for `thread` in the `src` directory.

---

<div class="post-metadata">

### Author: ![Amro](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Amro](https://discourse.julialang.org/u/Amro)
#### Post date: [February 3, 2023, 12:01pm UTC](https://discourse.julialang.org/t/based-on-which-packages-is-base-threads-built/93930/5 "2023-02-03T12:01:47Z")

</div>

Thanks!
