> For the complete documentation index, see [llms.txt](https://ella-yeonsu-choi.gitbook.io/cs-study/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ella-yeonsu-choi.gitbook.io/cs-study/en/deep-dive/blocking_nonblocking.md).

# Blocking vs. Non-blocking

## What are Blocking and Non-blocking?

* In programming and computer systems, these are two main approaches related to **how operations are executed**.
* The key difference between blocking and non-blocking is **the persistence of the operation** and **concurrent processing**.

## Blocking

* **A situation where, while one operation is being executed, other operations must wait until that operation is finished**.
* This means the system's resources and control are **exclusively held** by the blocking operation until it completes.
* As a result, other operations must wait for the blocking operation to finish, which can affect overall system performance.

## Non-blocking

* While one operation is being executed, **other operations can proceed concurrently**, and there is **no mutual waiting** between operations.
* In the non-blocking approach, **the persistence of operations is reduced**, so **overall system performance improves**, and even if one operation fails, other operations can continue.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ella-yeonsu-choi.gitbook.io/cs-study/en/deep-dive/blocking_nonblocking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
