> For the complete documentation index, see [llms.txt](https://pkuflyingpig.gitbook.io/pintos/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads.md).

# Lab1: Threads

{% hint style="warning" %} <mark style="color:red;">**Code Due: Thursday 04/02 11:59 pm**</mark>

<mark style="color:red;">**Design Doc Due: Sunday 04/05 11:59 pm**</mark>
{% endhint %}

**In this assignment, we give you a minimally functional thread system.** Your job is to **extend the functionality of this system to gain a better understanding of synchronization problems.**

* You will be working primarily in the `threads/` directory for this assignment, with some work in the `devices/` directory on the side.
* Compilation should be done in the `threads/` directory.

Before you read the description of this project, you should read all the sections in [GETTING STARTED](https://github.com/PKU-OS/Pintos-gitbook/blob/master/project-description/lab1-threads/broken-reference/README.md) and [C Standards](/pintos/appendix/coding-standards.md) section. You should at least skim the previous four sections in [Code Guide](/pintos/appendix/reference-guide.md), especially [Synchronization](/pintos/appendix/reference-guide/synchronization.md). **To complete this project you will also need to read** [**4.4BSD Scheduler**](/pintos/appendix/4.4bsd-scheduler.md)**.**

**Here are the sections in this chapter:**

{% content-ref url="/pages/DdI7K7I34qeo4fPByzBL" %}
[Background](/pintos/project-description/lab1-threads/background.md)
{% endcontent-ref %}

{% content-ref url="/pages/6jz9DcVTu57ZjRsMEHuy" %}
[Suggestions](/pintos/project-description/lab1-threads/suggestions.md)
{% endcontent-ref %}

{% content-ref url="/pages/3MKBaDiTlrUJiJkSAngk" %}
[Your Tasks](/pintos/project-description/lab1-threads/your-tasks.md)
{% endcontent-ref %}

{% content-ref url="/pages/SDlbIw0LI32h0hdJWJo3" %}
[FAQ](/pintos/project-description/lab1-threads/faq.md)
{% endcontent-ref %}

{% content-ref url="/pages/ed1YKedSabuptHkb4nK5" %}
[Submission](/pintos/project-description/lab1-threads/submission.md)
{% endcontent-ref %}


---

# 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://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads.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.
