Library / SDK
uxlfoundation/oneTBB avatar
uxlfoundation/oneTBB

oneTBB: task parallelism in C++ without managing threads yourself

oneAPI Threading Building Blocks (oneTBB)

6,756 stars1,188 forksC++Apache-2.0

At a glance

What is it?
oneTBB is the UXL Foundation's implementation of the oneAPI threading specification, a C++ library that lets you express logical parallelism instead of spawning threads. It is a good fit for data-parallel loops and streaming pipelines, and a poor fit if you need a single general thread pool for blocking I/O.
Who is it for?
Adopt oneTBB if you have CPU-bound C++ loops and pipelines that need to scale across cores without hand-written thread management, and if you can accept the oneTBB runtime as a dependency. Do not adopt it as a general-purpose thread pool for blocking I/O or as a replacement for a GPU programming model.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The problem oneTBB solves, and who it is aimed at

Writing portable parallel C++ by hand means owning thread creation, work distribution, load balancing and synchronization. The README states the library's position directly: oneTBB "simplifies the work of adding parallelism to complex applications, even if you are not a threading expert." The audience is therefore C++ developers who have a computational problem worth parallelizing but do not want to maintain a scheduler to do it.

The README lists what separates it from typical threading packages: it lets you specify logical parallelism instead of threads, it targets threading for performance, it is compatible with other threading packages, and it emphasizes scalable data parallel programming built on generic programming. That last point is the practical one. You hand oneTBB a callable and a range, not a fixed number of threads, and the runtime decides how to split the work.

That design has a consequence worth stating up front. Because you describe work rather than threads, the library is a poor match for code whose parallelism is really concurrency over blocking calls. A thread pool that exists to wait on sockets is not what this is.

How the runtime works: tasks, arenas and the flowgraph

The core abstraction is the task, not the thread. When you call a parallel algorithm, the library decomposes the range into tasks and schedules them across a pool of worker threads. The README frames the result as programs that are "portable, composable and have a future-proof scalability," which is the claim behind the composability topic: nested parallel regions share the same runtime instead of each demanding its own threads.

The repository layout reflects this. There is a src/ directory for the runtime and a separate thread_composability_manager/ directory, which is where the machinery for coordinating oneTBB with other threading runtimes lives. The include/ tree holds the public headers, and integration/ holds the glue for build systems and external consumers.

Above the task scheduler sit the parallel algorithms (parallel_for, parallel_reduce, parallel_for_each, parallel_pipeline, concurrent_hash_map, concurrent_priority_queue) and the flowgraph API, which models dependency graphs rather than ranges. The examples/ directory mirrors that split: examples/parallel_for/, examples/parallel_reduce/, examples/graph/, examples/task_arena/, examples/task_group/, examples/parallel_pipeline/. A task_arena is the mechanism for confining work to a subset of the runtime, and a task_group is the mechanism for waiting on a set of dynamically spawned tasks rather than a fixed range.

The library also ships tbbmalloc, listed in the repository topics, a scalable memory allocator that is part of the same distribution.

Installing oneTBB from source and running a first parallel_for

The README points to INSTALL.md for installation and describes it as "Installation from Sources". There is no documented single-line package install in the README itself, so the source build is the path the project describes. The repository carries CMakeLists.txt at the top level and a cmake/ directory with its own README, so CMake is the primary build system, with Bazel listed as "Basic support" in Bazel.md and MODULE.bazel and BUILD.bazel present at the top level.

INSTALL.md is the file that carries the actual configure and build commands for your platform, so follow it rather than guessing flags. The README does not reproduce those steps, and the cmake/README.md file documents the CMake build system itself, including the options it exposes.

Once the library is built and linked, the smallest useful program uses parallel_for over an index range. The README directs readers to examples/ and the oneAPI samples repository for working code, and examples/getting_started/ exists for exactly this purpose. The examples/parallel_for/ directory holds a complete, compilable version, and examples/README.md explains how the example set is organized.

What you should see is the body executing across multiple worker threads without you creating any. The pattern to copy is the one the examples demonstrate: you pass a range and a callable, and the runtime decides how to split it. The include path and namespace follow the oneTBB naming; if you are porting older code, the migration guide linked from the README covers the move from the TBB headers and namespace to the oneTBB ones.

The TBB to oneTBB migration is a real API break

The README devotes a separate documentation link to "Migrating from TBB to oneTBB", which tells you the project considers this a distinct task rather than a rename. The note in the README explains the naming change as a signal that the tool is part of the oneAPI ecosystem, but the migration guide is about more than naming.

If you have an existing TBB codebase, budget for the port. The guide is the authoritative source, and it is where you should look before assuming a header include swap is sufficient. The versioning policy in VERSIONING.md is the companion document: it tells you what compatibility guarantees the project makes between releases, which matters when you pin a version and later upgrade.

This is the clearest case where oneTBB is the wrong tool for a specific job: an existing codebase with deep TBB integration and no appetite for an API migration. The library will work, but the cost is a port, not a drop-in.

oneTBB versus OpenMP: different answers to the same question

The comparison people reach for is oneTBB against OpenMP, and the difference is in what you write. OpenMP parallelizes through compiler pragmas attached to existing loops and regions, which keeps the source close to its serial form and puts the transformation in the compiler. oneTBB is a library: you call functions and pass callables, and the parallelism is visible in the code as ordinary C++.

That difference drives the trade-offs. Pragmas are cheaper to add to a loop you already have and require no link-time dependency on a runtime library in the same way. Library calls compose better when the parallel structure is irregular, when you need a dependency graph rather than a loop, or when you want to nest parallel regions and control how they share the runtime. The README's claim that oneTBB "is compatible with other threading packages" is the relevant property here: it is designed to coexist rather than to own the process.

The flowgraph API is the part with no direct pragma equivalent. If your problem is a pipeline or a dataflow graph with stages that run concurrently, that is a structural fit for oneTBB and an awkward one for loop pragmas.

Maintenance, licensing and what an upgrade costs

The repository is not archived, and the last push was on 2026-09-22. Releases are versioned by year: v2023.1.0 on 2026-07-13, v2023.0.0 on 2026-04-30, and v2022.3.0 on 2025-10-29. That cadence means a minor version bump roughly every few months and a major version roughly yearly, so pinning to a specific release and reading RELEASE_NOTES.md before moving is the practical upgrade path.

Governance sits with the UXL Foundation, and the project is described as an implementation of the oneAPI specification. That matters for upgrade cost in two directions: the specification is the stable contract, and the implementation tracks it. The versioning policy in VERSIONING.md is where the project states what it promises across those boundaries.

The licence is Apache License, Version 2.0, per LICENSE.txt. The README notes that contributions submitted to the project are also made under that licence. Apache-2.0 is permissive and includes an explicit patent grant, which is the usual reason projects pick it over MIT for infrastructure code. That is a description of the licence text, not legal advice; if your organisation has rules about patent clauses or attribution, read LICENSE.txt and third-party-programs.txt yourself. The latter file exists at the top level and is where bundled third-party code is accounted for.

Editorial conclusion

Adopt oneTBB if you have CPU-bound C++ loops and pipelines that need to scale across cores without hand-written thread management, and if you can accept the oneTBB runtime as a dependency. Do not adopt it as a general-purpose thread pool for blocking I/O or as a replacement for a GPU programming model. Before committing, verify the minimum compiler version in SYSTEM_REQUIREMENTS.md, confirm the migration notes for the TBB to oneTBB API break apply to your code, and check whether your target platform is covered by the CMake build described in INSTALL.md.

Frequently asked questions

How do I install oneTBB?

The README points to INSTALL.md, titled Installation from Sources, for the supported path. The repository builds with CMake from the top-level CMakeLists.txt, and Bazel.md describes basic Bazel support.

What is oneTBB used for?

The README describes it as a C++ library for adding parallelism to complex applications, letting you specify logical parallelism instead of threads. It provides parallel algorithms, concurrent containers and a flowgraph API, and it targets threading for performance.

Is the Intel oneAPI Base Toolkit free?

The README does not discuss pricing or toolkits. It states only that oneTBB is licensed under the Apache License, Version 2.0, per LICENSE.txt, and that contributions submitted to the project are also made under that licence.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. uxlfoundation/oneTBB on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/uxlfoundation-onetbb.svg)](https://hysenlabs.com/projects/uxlfoundation-onetbb)