---
title: Multi-threading
description: "\"Shows how to enable multi-threading in PingOne Recognize using the Web SDK.\""
component: recognize
page_id: recognize:web-sdk:web-sdk-reference-multi-threaded
canonical_url: https://docs.pingidentity.com/recognize/web-sdk/web-sdk-reference-multi-threaded.html
llms_txt: https://docs.pingidentity.com/recognize/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
section_ids:
  enabling-multi-threading: Enabling multi-threading
  headless: Headless
  web-components: Web components
  security-headers: Security headers
---

# Multi-threading

Starting with v2.2, PingOne Recognize is single-threaded by default. Enable multi-threading to improve performance.

## Enabling multi-threading

PingOne Recognize supports WebAssembly (WASM) POSIX threads (pthreads). Enable multi-threading by adding the appropriate flag, as shown in the following examples:

### Headless

```javascript
await importKeylessWebAssemblyModule({
  ...,
  pthreads: true
})
```

### Web components

```html
<kl-auth
...
enable-wasm-pthreads
></kl-auth>
```

## Security headers

Multi-threading requires two security headers. If either header is missing or has an incorrect value, you cannot enable multi-threading.

|                              |                |
| ---------------------------- | -------------- |
| Name                         | Value          |
| Cross-Origin-Embedder-Policy | `require-corp` |
| Cross-Origin-Opener-Policy   | `same-origin`  |

When loading resources from external domains, use the `crossorigin` attribute. To learn more, refer to [Cross-Origin-Embedder-Policy: Avoiding COEP Blockage with CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Embedder-Policy#avoiding_coep_blockage_with_cors)
