# 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](https://pkuflyingpig.gitbook.io/pintos/appendix/coding-standards) section. You should at least skim the previous four sections in [Code Guide](https://pkuflyingpig.gitbook.io/pintos/appendix/reference-guide), especially [Synchronization](https://pkuflyingpig.gitbook.io/pintos/appendix/reference-guide/synchronization). **To complete this project you will also need to read** [**4.4BSD Scheduler**](https://pkuflyingpig.gitbook.io/pintos/appendix/4.4bsd-scheduler)**.**

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

{% content-ref url="lab1-threads/background" %}
[background](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads/background)
{% endcontent-ref %}

{% content-ref url="lab1-threads/suggestions" %}
[suggestions](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads/suggestions)
{% endcontent-ref %}

{% content-ref url="lab1-threads/your-tasks" %}
[your-tasks](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads/your-tasks)
{% endcontent-ref %}

{% content-ref url="lab1-threads/faq" %}
[faq](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads/faq)
{% endcontent-ref %}

{% content-ref url="lab1-threads/submission" %}
[submission](https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads/submission)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://pkuflyingpig.gitbook.io/pintos/project-description/lab1-threads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
