---
title: "Critical Section Controller"
description: "Configure the JMeter Critical Section Controller logic controllers: properties, defaults, and practical usage notes for building reliable load tests."
url: https://docs.jmeter.ai/components/critical-section-controller/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# Critical Section Controller

*Part of the **Logic Controllers** category. Also documented in context in the [full Component Reference](/user-manual/component-reference/#critical-section-controller).*

![Critical Section Controller](/images/screenshots/logic-controller/critical-section-controller.png)

The Critical Section Controller ensures that its children elements (samplers/controllers, etc.) will be executed
by only one thread as a named lock will be taken before executing children of controller.

The figure below shows an example of using Critical Section Controller, in the figure below 2 Critical Section Controllers ensure
that:

- `DS2-\${__threadNum}` is executed only by one thread at a time
- `DS4-\${__threadNum}` is executed only by one thread at a time

![Test Plan using Critical Section Controller](/images/screenshots/logic-controller/critical-section-controller-tp.png)

*Test Plan using Critical Section Controller*

| Name | Required | Description |
| --- | --- | --- |
| Lock Name | Yes | Lock that will be taken by controller, ensure you use different lock names for unrelated sections |

> **Note**
> Critical Section Controller takes locks only within one JVM, so if using Distributed testing ensure your use case does not rely on all threads of all JVMs blocking.

^

## Related

- [Logic Controllers & Flow Control](/topics/logic-controllers-flow-control/)
- [Full Component Reference](/user-manual/component-reference/)
- [Functions and Variables](/user-manual/functions/)
